C# Class Helios.Concurrency.SingleThreadEventExecutor

A single-threaded IEventExecutor
Inheritance: AbstractScheduledEventExecutor
Mostra file Open project: helios-io/helios Class Usage Examples

Public Methods

Method Description
AddShutdownHook ( IRunnable hook ) : void

Add a IRunnable which will be executed on the shutdown of this instance

Execute ( IRunnable task ) : void
GracefulShutdownAsync ( System.TimeSpan quietPeriod, System.TimeSpan timeout ) : Task
IsInEventLoop ( Thread thread ) : bool
RemoveShutdownHook ( IRunnable hook ) : void

Remove a previously added IRunnable as a shutdown hook

SingleThreadEventExecutor ( string threadName, System.TimeSpan breakoutInterval ) : System
Unwrap ( ) : IEventExecutor

Protected Methods

Method Description
CleanupAndShutdown ( bool success ) : void
ConfirmShutdown ( ) : bool
RunAllTasks ( ) : bool
Wakeup ( bool inEventLoop ) : void

Private Methods

Method Description
FetchFromScheduledTaskQueue ( ) : void
Loop ( ) : void
PollTask ( ) : IRunnable
RunAllTasks ( System.TimeSpan breakoutInternval ) : bool
RunShutdownHooks ( ) : bool

Method Details

AddShutdownHook() public method

Add a IRunnable which will be executed on the shutdown of this instance
public AddShutdownHook ( IRunnable hook ) : void
hook IRunnable
return void

CleanupAndShutdown() protected method

protected CleanupAndShutdown ( bool success ) : void
success bool
return void

ConfirmShutdown() protected method

protected ConfirmShutdown ( ) : bool
return bool

Execute() public method

public Execute ( IRunnable task ) : void
task IRunnable
return void

GracefulShutdownAsync() public method

public GracefulShutdownAsync ( System.TimeSpan quietPeriod, System.TimeSpan timeout ) : Task
quietPeriod System.TimeSpan
timeout System.TimeSpan
return Task

IsInEventLoop() public method

public IsInEventLoop ( Thread thread ) : bool
thread Thread
return bool

RemoveShutdownHook() public method

Remove a previously added IRunnable as a shutdown hook
public RemoveShutdownHook ( IRunnable hook ) : void
hook IRunnable
return void

RunAllTasks() protected method

protected RunAllTasks ( ) : bool
return bool

SingleThreadEventExecutor() public method

public SingleThreadEventExecutor ( string threadName, System.TimeSpan breakoutInterval ) : System
threadName string
breakoutInterval System.TimeSpan
return System

Unwrap() public method

public Unwrap ( ) : IEventExecutor
return IEventExecutor

Wakeup() protected method

protected Wakeup ( bool inEventLoop ) : void
inEventLoop bool
return void