Monitor Asynchronous Actions using Event Handlers
Some of the actions that you can send to Media Server are asynchronous. Asynchronous actions do not run immediately, but are added to a queue. This means that the person or application that sends the action does not receive an immediate response. However, you can configure Media Server to call an event handler when an asynchronous action starts, finishes, or encounters an error.
You might use an event handler to:
- Return data about an event back to the application that sent the action.
- Write event data to a text file, to log any errors that occur.
You can also use event handlers to monitor the size of asynchronous action queues. If a queue becomes full this might indicate a problem, or that applications are making requests to Media Server faster than they can be processed.
Media Server can call an event handler for the following events.
OnStart | The OnStart event handler is called when Media Server starts processing an asynchronous action. |
OnFinish | The OnFinish event handler is called when Media Server successfully finishes processing an asynchronous action. |
OnError | The OnError event handler is called when an asynchronous action fails and cannot continue. |
OnQueueEvent |
The
|
Media Server supports the following types of event handler:
- The
TextFileHandler
writes event data to a text file. - The
HttpHandler
sends event data to a URL. - The
LuaHandler
runs a Lua script. The event data is passed into the script.