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.
Показать файл Открыть проект

Открытые методы

Метод Описание
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