public interface IProgram
{
public static virtual bool SupportsCancellation => true;
public static abstract Task RunAsync(ProgramContext context);
}
If SupportsCancellation is true, ProgramHost will wire up a Signaled event handler to trigger a CancellationTokenSource whose CancellationToken gets passed as a property on ProgramContext.
(The reason for making cancellation support optional is that wiring up Signaled has side effects that may not be tolerable - see #64.)
Depends on:
Something like:
If
SupportsCancellation
istrue
,ProgramHost
will wire up aSignaled
event handler to trigger aCancellationTokenSource
whoseCancellationToken
gets passed as a property onProgramContext
.(The reason for making cancellation support optional is that wiring up
Signaled
has side effects that may not be tolerable - see #64.)