Photomechanics API
OneAtATimeTaskRunner Class Reference

Provides logic to ensure that given asynchronous action will not be run concurrently. More...

Public Member Functions

 OneAtATimeTaskRunner (Func< Task > taskFactory)
 Constructs wrapper around given task factory.
 
async Task Run ()
 Either start wrapped action, or await already running one.
 

Properties

Boolean IsRunning [get]
 Determines whether wrapped action is currently executing.
 

Detailed Description

Provides logic to ensure that given asynchronous action will not be run concurrently.

Useful for situations when wrapped action (like reloading cameras manager) disposes some Photomechanics.Photo3DStudio.Common.Interfaces.IAsyncDisposableExtended instance, it's Disposed event causes something else to dispose, etc, etc and in the end it calls the same action that started this disposal chain. Similar logic is implemented in Photomechanics.Photo3DStudio.Common.Interfaces.IAsyncDisposableExtended dispose routines themselves.