PostSharpAPI ReferencePost­Sharp.​Patterns.​ThreadingActor­Dispatcher
Open sandboxFocus

Class ActorDispatcher

A dispatcher compatible with the ActorThreadingModel threading model, with a message queue based on a ConcurrentQueue The queue itself is processed from the ThreadPool.

Inheritance
ActorDispatcher
Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading.dll
Syntax
public class ActorDispatcher : Object, IActorDispatcher, IDispatcher

Constructors

Name Description
ActorDispatcher()

Initializes a new ActorDispatcher.

Properties

Name Description
IsQueueEmpty

Determines whether there are work items in the queue.

Methods

Name Description
BeginInvoke(SendOrPostCallback, Object)

Queues an action for asynchronous execution.

CheckAccess()

Determines whether the current thread has access to the current dispatcher.

Invoke(SendOrPostCallback, Object)

Executes an action synchronously.

MustYield(Int32)

Determines whether the ProcessQueue() method should interrupt the processing of the message queue before the queue is empty.

OnQueueEmpty()

Method invoked when the queue becomes empty. The default implementation does not do anything.

ProcessQueue()

Processes the message queue synchronously.

ScheduleProcessQueue()

Schedules the execution of the ProcessQueue(), typically on a worker thread or in the ThreadPool. The default implementation uses the ThreadPool on platforms that have a thread pool, otherwise it schedules a new Task.

Explicit Interface Implementations

Name Description
IActorDispatcher.Initialize()
IDispatcher.IsInvokeSupported
IDispatcher.SynchronizationContext