C# Class NetMQ.Core.Reaper

Class Reaper is a ZObject and implements IPollEvents. The Reaper is dedicated toward handling socket shutdown asynchronously and cleanly. By passing this task off to the Reaper, the message-queueing subsystem can terminate immediately.
Inheritance: ZObject, IPollEvents
Show file Open project: NetMQ/NetMQ3-x Class Usage Examples

Private Properties

Property Type Description

Public Methods

Method Description
Destroy ( ) : void

Release any contained resources - by destroying the poller and closing the mailbox.

ForceStop ( ) : void
InEvent ( ) : void

Handle input-ready events, by receiving and processing any commands that are waiting in the mailbox.

OutEvent ( ) : void

This method normally is for handling output-ready events, which don't apply here.

Reaper ( [ ctx, int threadId ) : System

Create a new Reaper with the given thread-id. This will have a new Poller with the name "reaper-" + thread-id, and a Mailbox of that same name.

Start ( ) : void

Start the contained Poller to begin polling.

Stop ( ) : void

Issue the Stop command to this Reaper object.

TimerEvent ( int id ) : void

This would be called when a timer expires - however in this event NotSupportedException would be thrown.

Protected Methods

Method Description
ProcessForceStop ( ) : void
ProcessReap ( SocketBase socket ) : void

Add the given socket to the list to be reaped (terminated).

ProcessReaped ( ) : void

Respond to having one of the sockets that are marked for reaping, - finished being reaped, and if there are none left - send the Done command and stop the poller.

ProcessStop ( ) : void

Respond to the Stop command by signaling the polling-loop to terminate, and if there're no sockets left to reap - stop the poller.

Method Details

Destroy() public method

Release any contained resources - by destroying the poller and closing the mailbox.
public Destroy ( ) : void
return void

ForceStop() public method

public ForceStop ( ) : void
return void

InEvent() public method

Handle input-ready events, by receiving and processing any commands that are waiting in the mailbox.
public InEvent ( ) : void
return void

OutEvent() public method

This method normally is for handling output-ready events, which don't apply here.
You must not call OutEvent on a Reaper.
public OutEvent ( ) : void
return void

ProcessForceStop() protected method

protected ProcessForceStop ( ) : void
return void

ProcessReap() protected method

Add the given socket to the list to be reaped (terminated).
protected ProcessReap ( SocketBase socket ) : void
socket SocketBase the socket to add to the list for termination
return void

ProcessReaped() protected method

Respond to having one of the sockets that are marked for reaping, - finished being reaped, and if there are none left - send the Done command and stop the poller.
protected ProcessReaped ( ) : void
return void

ProcessStop() protected method

Respond to the Stop command by signaling the polling-loop to terminate, and if there're no sockets left to reap - stop the poller.
protected ProcessStop ( ) : void
return void

Reaper() public method

Create a new Reaper with the given thread-id. This will have a new Poller with the name "reaper-" + thread-id, and a Mailbox of that same name.
public Reaper ( [ ctx, int threadId ) : System
ctx [ the Ctx for this to be in
threadId int an integer id to give to the thread this will live on
return System

Start() public method

Start the contained Poller to begin polling.
public Start ( ) : void
return void

Stop() public method

Issue the Stop command to this Reaper object.
public Stop ( ) : void
return void

TimerEvent() public method

This would be called when a timer expires - however in this event NotSupportedException would be thrown.
You must not call TimerEvent on a Reaper.
public TimerEvent ( int id ) : void
id int an integer used to identify the timer
return void