TLibeventAsyncManager

A TAsyncManager implementation based on libevent.

The libevent loop for handling non-blocking sockets is run in a background thread, which is lazily spawned. The thread is not daemonized to avoid crashes on program shutdown, it is only stopped when the manager instance is destroyed. So, to ensure a clean program teardown, either make sure this instance gets destroyed (e.g. by using scope), or manually call stop() at the end.

Constructors

this
this()
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

addOneshotListener
void addOneshotListener(Socket socket, TAsyncEventType eventType, Duration timeout, TSocketEventListener listener)
Undocumented in source. Be warned that the author may not have intended to support it.
addOneshotListener
void addOneshotListener(Socket socket, TAsyncEventType eventType, TSocketEventListener listener)
Undocumented in source. Be warned that the author may not have intended to support it.
delay
void delay(Duration duration, void delegate() work)
Undocumented in source. Be warned that the author may not have intended to support it.
execute
void execute(TAsyncTransport transport, Work work, TCancellation cancellation)
Undocumented in source. Be warned that the author may not have intended to support it.
stop
bool stop(Duration waitFinishTimeout)
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From TAsyncSocketManager

addOneshotListener
void addOneshotListener(Socket socket, TAsyncEventType eventType, Duration timeout, TSocketEventListener listener)
void addOneshotListener(Socket socket, TAsyncEventType eventType, TSocketEventListener listener)

Adds a listener that is triggered once when an event of the specified type occurs, and removed afterwards.

Meta