LongSynchronizedOperation Class

Represents a long-running synchronized operation that cannot run while it is already in progress.

Definition

Namespace: Gemstone.Threading.SynchronizedOperations
Assembly: Gemstone.Threading (in Gemstone.Threading.dll) Version: 1.0.110 -- Release Build+13c244059615c58a533059438f38d7e59ef0c2ea
public class LongSynchronizedOperation : SynchronizedOperationBase
Inheritance
Object    SynchronizedOperationBase    LongSynchronizedOperation

Remarks

The action performed by the LongSynchronizedOperation is executed on its own dedicated thread when running the operation in the foreground asynchronously. When running on its own thread, the action is executed in a tight loop until all pending operations have been completed. This type of synchronized operation should be preferred if operations may take a long time, block the thread, or put it to sleep. It is also recommended to prefer this type of operation if the speed of the operation is not critical or if completion of the operation is critical, such as when saving data to a file.

Constructors

LongSynchronizedOperation(Action) Creates a new instance of the LongSynchronizedOperation class.
LongSynchronizedOperation(ActionCancellationToken) Creates a new instance of the LongSynchronizedOperation class.
LongSynchronizedOperation(Action, ActionException) Creates a new instance of the LongSynchronizedOperation class.
LongSynchronizedOperation(ActionCancellationToken, ActionException) Creates a new instance of the LongSynchronizedOperation class.

Properties

CancellationToken Gets or sets CancellationToken to use for cancelling actions.
(Inherited from SynchronizedOperationBase)
IsBackground Gets or sets whether or not the thread executing the action is a background thread.
IsPending Gets flag indicating if the synchronized operation has an additional operation that is pending execution after the currently running action has completed.
(Inherited from SynchronizedOperationBase)
IsRunning Gets flag indicating if the synchronized operation is currently executing its action.
(Inherited from SynchronizedOperationBase)

Methods

EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
ExecuteAction Executes the action once on the current thread.
(Inherited from SynchronizedOperationBase)
ExecuteActionAsync Executes the action on a separate thread.
(Overrides SynchronizedOperationBaseExecuteActionAsync)
Factory Factory method to match the SynchronizedOperationFactory signature.
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ProcessException Processes an exception thrown by an operation.
(Inherited from SynchronizedOperationBase)
Run Executes the action on current thread or marks the operation as pending if the operation is already running.
(Inherited from SynchronizedOperationBase)
RunAsync Executes the action on another thread or marks the operation as pending if the operation is already running.
(Inherited from SynchronizedOperationBase)
ToStringReturns a string that represents the current object.
(Inherited from Object)
TryRun Attempts to execute the action on current thread. Does nothing if the operation is already running.
(Inherited from SynchronizedOperationBase)
TryRunAsync Attempts to execute the action on another thread. Does nothing if the operation is already running.
(Inherited from SynchronizedOperationBase)

See Also