C# 클래스 NetMQ.Core.Utils.PollerBase

This serves as the parent-class for Poller and Proactor. It provides for managing a list of timers (ITimerEvents) - adding, cancelling, and executing them, and a Load property.
파일 보기 프로젝트 열기: somdoron/netmq

공개 메소드들

메소드 설명
AddTimer ( long timeout, [ sink, int id ) : void

Add a TimerInfo to the internal list, created from the given sink and id - to expire in the given number of milliseconds. Afterward the expiration method TimerEvent on the sink object will be called with argument set to id.

CancelTimer ( [ sink, int id ) : void

Cancel the timer that was created with the given sink object with the given Id.

The complexity of this operation is O(n). We assume it is rarely used.

보호된 메소드들

메소드 설명
AdjustLoad ( int amount ) : void

Add the given amount to the load. This is called by individual poller implementations to manage the load.

This is thread-safe.

ExecuteTimers ( ) : int

Execute any timers that are due. Return the number of milliseconds to wait to match the next timer or 0 meaning "no timers".

PollerBase ( ) : System.Collections.Generic

Create a new PollerBase object - which simply creates an empty m_timers collection.

메소드 상세

AddTimer() 공개 메소드

Add a TimerInfo to the internal list, created from the given sink and id - to expire in the given number of milliseconds. Afterward the expiration method TimerEvent on the sink object will be called with argument set to id.
public AddTimer ( long timeout, [ sink, int id ) : void
timeout long the timeout-period in milliseconds of the new timer
sink [ the IProactorEvents to add for the sink of the new timer
id int the Id to assign to the new TimerInfo
리턴 void

AdjustLoad() 보호된 메소드

Add the given amount to the load. This is called by individual poller implementations to manage the load.
This is thread-safe.
protected AdjustLoad ( int amount ) : void
amount int
리턴 void

CancelTimer() 공개 메소드

Cancel the timer that was created with the given sink object with the given Id.
The complexity of this operation is O(n). We assume it is rarely used.
public CancelTimer ( [ sink, int id ) : void
sink [ the ITimerEvent that the timer was created with
id int the Id of the timer to cancel
리턴 void

ExecuteTimers() 보호된 메소드

Execute any timers that are due. Return the number of milliseconds to wait to match the next timer or 0 meaning "no timers".
protected ExecuteTimers ( ) : int
리턴 int

PollerBase() 보호된 메소드

Create a new PollerBase object - which simply creates an empty m_timers collection.
protected PollerBase ( ) : System.Collections.Generic
리턴 System.Collections.Generic