Vonage Video API Windows SDK
Classes | Public Member Functions | Protected Member Functions | List of all members
OpenTok.DedicatedWorkerDispatcher Class Reference

Implementation of IDispatcher that uses a dedicated worker thread to deliver events. Available for all presentation frameworks (WinForms, WPF, etc.). Delivery order is guaranteed. Each instance of this IDispatcher uses a different thread so if using the same queue is required, create only one instance of DedicatedWorkerDispatcher and pass it around to every OpenTok object that accepts an IDispatcher. CPU-intensive or long-running tasks can be executed in the event handlers, as the dedicated thread is not used for any other purpose. UI can't be manipulated directly in the event handlers. If this is required, events must be dispatched first to the UI thread. More...

Inherits OpenTok.IDispatcher, and IDisposable.

Public Member Functions

void DispatchEvent (object sender, EventHandler handler)
 Schedules a parameterless event. More...
 
void DispatchEvent< T > (object sender, EventHandler< T > handler, T args)
 Schedules a typed parameter event. More...
 
void Dispose ()
 
void DispatchEvent (object sender, EventHandler handler)
 Schedules a parameterless event. More...
 
void DispatchEvent< T > (object sender, EventHandler< T > handler, T args)
 Schedules a typed parameter event. More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 

Detailed Description

Implementation of IDispatcher that uses a dedicated worker thread to deliver events. Available for all presentation frameworks (WinForms, WPF, etc.). Delivery order is guaranteed. Each instance of this IDispatcher uses a different thread so if using the same queue is required, create only one instance of DedicatedWorkerDispatcher and pass it around to every OpenTok object that accepts an IDispatcher. CPU-intensive or long-running tasks can be executed in the event handlers, as the dedicated thread is not used for any other purpose. UI can't be manipulated directly in the event handlers. If this is required, events must be dispatched first to the UI thread.

Member Function Documentation

◆ DispatchEvent()

void OpenTok.DedicatedWorkerDispatcher.DispatchEvent ( object  sender,
EventHandler  handler 
)

Schedules a parameterless event.

Parameters
senderOriginator of the event.
handlerMethod to call after scheduling to the new thread.

Implements OpenTok.IDispatcher.

◆ DispatchEvent< T >()

void OpenTok.DedicatedWorkerDispatcher.DispatchEvent< T > ( object  sender,
EventHandler< T >  handler,
args 
)

Schedules a typed parameter event.

Template Parameters
TThe type of the parameter
Parameters
senderOriginator of the event.
handlerMethod to call after scheduling to the new thread.
argsParameter to pass to the handler.

Implements OpenTok.IDispatcher.

Type Constraints
T :EventArgs