OpenTok.ThreadPoolDispatcher

public class ThreadPoolDispatcher : OpenTok.IDispatcher

Implementation of IDispatcher that uses different threads from the managed ThreadPool to deliver events. Available for all presentation frameworks (WinForms, WPF, etc.). Important: Delivery order is not guaranteed. All instances of ThreadPoolDispatcher dispatch events to the same thread pool, so it doesn't matter whether the same ThreadPoolDispatcher is always used or a new one is created every time an IDispatcher is required. CPU-intensive or long-running tasks can be executed in the event handlers, as the underlying thread pool system is prepared to handle this. UI can't be manipulated directly in the event handlers. If this is required, events must be scheduled first to the UI thread.

Methods

Name Description
DispatchEvent(sender, handler)
DispatchEvent< T >(sender, handler, args)

DispatchEvent(sender, handler)

Parameters:
Name Type Description
sender object Originator of the event.
handler EventHandler Method to call after scheduling to the new thread.

DispatchEvent< T >(sender, handler, args)

Parameters:
Name Type Description
sender object Originator of the event.
handler EventHandler&lt;T&gt; Method to call after scheduling to the new thread.
args T Parameter to pass to the handler.