C# Class Amnesia.SessionTracker

Mostrar archivo Open project: vc3/Amnesia Class Usage Examples

Private Properties

Property Type Description
DecrementActivityCount void
EnsureNotPaused void
Pause void
Resume void

Public Methods

Method Description
AssertActivityStarted ( ) : void

Throws an exception if the current thread is not tied to an activity

AsyncDependentActivityEnded ( ) : void

Called by the async thread when its activity is complete

AsyncDependentActivityIdentified ( ) : ActivityInfo

Called by the thread that is initiating an async activity on a second thread.

AsyncDependentActivityStarted ( ActivityInfo parentActivity ) : void

Called by the thread executing the async activity

EndActivity ( ) : void

Ends an activity started with StartActivity or AsyncActivityStarted

Exclusive ( int timeoutMS, ILog log ) : IDisposable

Stop all new activities and wait for the current ones to complete. When this method returns, all activities (execpt for the current Amnesia one) will have completed and any future activities will be denied.

ParallelDependentActivityCompleted ( ) : void

Called by the thread that is initiating a parallel activity to indicate that all threads should be completed.

ParallelDependentActivityEnded ( ) : void

Called by the async thread when its activity is complete

ParallelDependentActivityIdentified ( ) : ActivityInfo

Called by the thread that is initiating an async activity on a second thread.

ParallelDependentActivityStarted ( ActivityInfo parentActivity ) : void

Called by the thread executing the async activity

StartActivity ( ) : void

Private Methods

Method Description
DecrementActivityCount ( ) : void

Called when an activity is completed. Both async and sync activities.

EnsureNotPaused ( ) : void

Caller is responsible for synchronization

Pause ( int timeoutMS, ILog log ) : void

Stop all incoming activities and wait for the current activities to complete. When this method returns, all activities (except for the current Amnesia one) will have completed and any future activities will be denied.

Resume ( ) : void

Allow new activites to start

Method Details

AssertActivityStarted() public method

Throws an exception if the current thread is not tied to an activity
public AssertActivityStarted ( ) : void
return void

AsyncDependentActivityEnded() public method

Called by the async thread when its activity is complete
public AsyncDependentActivityEnded ( ) : void
return void

AsyncDependentActivityIdentified() public method

Called by the thread that is initiating an async activity on a second thread.
public AsyncDependentActivityIdentified ( ) : ActivityInfo
return ActivityInfo

AsyncDependentActivityStarted() public method

Called by the thread executing the async activity
public AsyncDependentActivityStarted ( ActivityInfo parentActivity ) : void
parentActivity ActivityInfo
return void

EndActivity() public method

Ends an activity started with StartActivity or AsyncActivityStarted
public EndActivity ( ) : void
return void

Exclusive() public method

Stop all new activities and wait for the current ones to complete. When this method returns, all activities (execpt for the current Amnesia one) will have completed and any future activities will be denied.
public Exclusive ( int timeoutMS, ILog log ) : IDisposable
timeoutMS int
log ILog
return IDisposable

ParallelDependentActivityCompleted() public method

Called by the thread that is initiating a parallel activity to indicate that all threads should be completed.
public ParallelDependentActivityCompleted ( ) : void
return void

ParallelDependentActivityEnded() public method

Called by the async thread when its activity is complete
public ParallelDependentActivityEnded ( ) : void
return void

ParallelDependentActivityIdentified() public method

Called by the thread that is initiating an async activity on a second thread.
public ParallelDependentActivityIdentified ( ) : ActivityInfo
return ActivityInfo

ParallelDependentActivityStarted() public method

Called by the thread executing the async activity
public ParallelDependentActivityStarted ( ActivityInfo parentActivity ) : void
parentActivity ActivityInfo
return void

StartActivity() public method

public StartActivity ( ) : void
return void