C# Class NetworkCommsDotNet.Tools.CommsThreadPool

A compact thread pool used by NetworkComms.Net to run packet handlers
Show file Open project: MarcFletcher/NetworkComms.Net Class Usage Examples

Public Methods

Method Description
BeginShutdown ( ) : void

Prevent any additional threads from starting. Returns immediately.

CommsThreadPool ( ) : System

Create a new NetworkComms.Net thread pool

EndShutdown ( int threadShutdownTimeoutMS = 1000 ) : void

Prevent any additional threads from starting and return once all existing workers have completed.

EnqueueItem ( QueueItemPriority priority, WaitCallback callback, object state ) : void

Enqueue a callback to the thread pool.

ToString ( ) : string

Provides a brief string summarisation the state of the thread pool

Method Details

BeginShutdown() public method

Prevent any additional threads from starting. Returns immediately.
public BeginShutdown ( ) : void
return void

CommsThreadPool() public method

Create a new NetworkComms.Net thread pool
public CommsThreadPool ( ) : System
return System

EndShutdown() public method

Prevent any additional threads from starting and return once all existing workers have completed.
public EndShutdown ( int threadShutdownTimeoutMS = 1000 ) : void
threadShutdownTimeoutMS int
return void

EnqueueItem() public method

Enqueue a callback to the thread pool.
public EnqueueItem ( QueueItemPriority priority, WaitCallback callback, object state ) : void
priority QueueItemPriority The priority with which to enqueue the provided callback
callback WaitCallback The callback to execute
state object The state parameter to pass to the callback when executed
return void

ToString() public method

Provides a brief string summarisation the state of the thread pool
public ToString ( ) : string
return string