PostSharpAPI ReferencePost­Sharp.​Patterns.​ThreadingDispatched­Execution­Mode
Open sandboxFocus

DispatchedExecutionMode Class

Determines whether the caller of a dispatched method (see DispatchedAttribute) waits for the called method.

Inheritance
DispatchedExecutionMode
Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading.dll
Syntax
public sealed class DispatchedExecutionMode : Enum

Fields

Name Description
Blocking

The caller waits for the called method in all cases.

Default

Default (Blocking).

NonBlocking

The caller never waits for the called method. The method is enqueued for later execution even on the same context. Methods that have a non-void return type or ref or out parameters cannot be dispatched in non-blocking mode.

NonBlockingContextSwitch

If the caller context equals the target context (e.g. if the caller is the UI thread and the object is affine to the UI thread), the method is invoked immediately in the current context in a blocking way. Otherwise, if a context switch is necessary, the method call is enqueued for later execution and the caller continues without waiting. Methods that have a non-void return type or ref or out parameters cannot be dispatched in non-blocking mode.

value__