EpollSelectDispatcher

EpollSelectDispatcher

Constructors

this
this(ITimeoutManager timeout_manager, uint max_events)

Constructor

this
this(uint max_events)

Constructor; disables the timeout feature.

Destructor

~this
~this()

Destructor.

Members

Aliases

Event
alias Event = ISelectClient.Event

Event alias used internally

SelectCycleCallback
alias SelectCycleCallback = void delegate()

Delegate to be called each time select cycle finished.

Functions

changeClient
bool changeClient(ISelectClient current, ISelectClient next)

Changes the clients of a registered conduit from current to next.

eventLoop
void eventLoop(bool delegate() select_cycle_hook, bool delegate(Exception) unhandled_exception_hook)

While there are clients registered, repeatedly waits for registered events to happen, invokes the corresponding event handlers of the registered clients and unregisters the clients if they desire so.

modify
bool modify(ISelectClient client)

Modifies the registration of client using EPOLL_CTL_MOD. More precisely, the events of the current registration of client.fileHandle are set to client.events and the registration attachment is set to client.

num_registered
size_t num_registered()

IEpollSelectDispatcherInfo interface method.

onCycleEnd
void onCycleEnd(SelectCycleCallback cb)

Adds new callback to the queue of delegates to be called after the current select cycle. It will only be kept for a single cycle.

register
bool register(ISelectClient client)

Adds or modifies a client registration.

resetCounters
void resetCounters()

Resets the counters returned by selects() and timeouts().

select
uint select(bool exit_asap)

Executes an epoll select.

selects
ulong selects()
setExpiryRegistration
bool setExpiryRegistration(ISelectClient client)

Sets a timeout manager expiry registration to client if the timeout feature is enabled. This must be done exactly once for each select client that should be able to time out. If the timeout feature is disabled, nothing is done.

shutdown
void shutdown()

Causes the event loop to exit before entering the next wait cycle.

timeout_enabled
bool timeout_enabled()

true if the timeout feature is enabled.

timeouts
ulong timeouts()
unregister
int unregister(ISelectClient client, bool remove_from_selected_set)

Removes a client registration. Does not fail/throw if the client is not registered.

Static variables

DefaultMaxEvents
uint DefaultMaxEvents;

Default maximum number of file descriptors for which events can be reported with one epoll_wait() call.

Inherited Members

From IEpollSelectDispatcherInfo

num_registered
size_t num_registered()
selects
ulong selects()
timeouts
ulong timeouts()
resetCounters
void resetCounters()

Resets the counters returned by selects() and timeouts().

Meta