EventLoop

Interface of event loop.

abstract
class EventLoop {}

Members

Enums

State
enum State
Undocumented in source.

Functions

addSignalHandler
void addSignalHandler(int sig, void delegate() handler)
Undocumented in source.
callAt
auto callAt(SysTime when, Dg dg, Args args)

Arrange for the callback to be called at the given absolute timestamp when (an int or float), using the same time reference as time().

callExceptionHandler
void callExceptionHandler(ExceptionContext exceptionContext)

Call the current event loop's exception handler.

callLater
auto callLater(Duration delay, Dg dg, Args args)

Arrange for the callback to be called after the given delay.

callSoon
auto callSoon(Dg dg, Args args)

Arrange for a callback to be called as soon as possible.

callSoonThreadSafe
auto callSoonThreadSafe(Dg dg, Args args)

Like $(D_PSYMBOL callSoon()), but thread safe.

close
void close()

Close the event loop. The loop must not be running.

createConnection
auto createConnection(ProtocolFactory protocolFactory, char[] host, char[] service, SslContext sslContext, AddressFamily addressFamily, ProtocolType protocolType, AddressInfoFlags addressInfoFlags, Socket socket, char[] localHost, char[] localService, char[] serverHostname)

Create a streaming transport connection to a given Internet host and port: socket family $(D_PSYMBOL AddressFamily.INET) or $(D_PSYMBOL AddressFamily.INET6) depending on host (or family if specified), socket type $(D_PSYMBOL SocketType.STREAM).

createDatagramEndpoint
auto createDatagramEndpoint(DatagramProtocolFactory datagramProtocolFactory, char[] localHost, char[] localService, char[] remoteHost, char[] remoteService, AddressFamily addressFamily, ProtocolType protocolType, AddressInfoFlags addressInfoFlags)

Create datagram connection: socket family $(D_PSYMBOL AddressFamily.INET) or $(D_PSYMBOL AddressFamily.INET6) depending on host (or family if specified), socket type $(D_PSYMBOL SocketType.DGRAM).

createServer
Server createServer(ProtocolFactory protocolFactory, char[] host, char[] service, AddressFamily addressFamily, AddressInfoFlags addressInfoFlags, Socket socket, int backlog, SslContext sslContext, bool reuseAddress)

A coroutine which creates a TCP server bound to host and port.

createTask
auto createTask(Coroutine coroutine, Args args)

Schedule the execution of a fiber object: wrap it in a future.

createUnixConnection
auto createUnixConnection(ProtocolFactory protocolFactory, char[] path, SslContext sslContext, Socket socket, char[] serverHostname)

Create UNIX connection: socket family $(D_PSYMBOL AddressFamily.UNIX), socket type $(D_PSYMBOL SocketType.STREAM). The UNIX socket family is used to communicate between processes on the same machine efficiently.

createUnixServer
Server createUnixServer(ProtocolFactory protocolFactory, char[] path, Socket socket, int backlog, SslContext sslContext)

Similar to $(D_PSYMBOL EventLoop.createServer()), but specific to the socket family $(D_PSYMBOL AddressFamily.UNIX).

defaultExceptionHandler
void defaultExceptionHandler(ExceptionContext exceptionContext)

Default exception handler.

getAddressInfo
AddressInfo[] getAddressInfo(char[] host, char[] service, AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType, AddressInfoFlags addressInfoFlags)
Undocumented in source.
isClosed
bool isClosed()
isRunning
bool isRunning()
makeDatagramTransport
DatagramTransport makeDatagramTransport(Socket socket, DatagramProtocol datagramProtocol, Address remoteAddress, Waiter waiter)
Undocumented in source.
makeSocketTransport
Transport makeSocketTransport(Socket socket, Protocol protocol, Waiter waiter)
Undocumented in source.
removeSignalHandler
void removeSignalHandler(int sig)
Undocumented in source.
runForever
void runForever()

Run until $(D_PSYMBOL stop()) is called.

runUntilComplete
T runUntilComplete(Future!T future)

Run until $(PARAM future) is done.

scheduleCallback
void scheduleCallback(CallbackHandle callback)
Undocumented in source.
scheduleCallback
void scheduleCallback(Duration delay, CallbackHandle callback)
Undocumented in source.
scheduleCallback
void scheduleCallback(SysTime when, CallbackHandle callback)
Undocumented in source.
scheduleCallbackThreadSafe
void scheduleCallbackThreadSafe(CallbackHandle callback)
Undocumented in source.
setExceptionHandler
void setExceptionHandler(ExceptionHandler exceptionHandler)

Set handler as the new event loop exception handler.

socketConnect
void socketConnect(Socket socket, Address address)
Undocumented in source.
startServing
void startServing(ProtocolFactory protocolFactory, Socket socket, SslContext sslContext, ServerImpl server)
Undocumented in source.
stop
void stop()

Stop running the event loop.

stopServing
void stopServing(Socket socket)
Undocumented in source.
time
SysTime time()

Return the current time according to the event loop’s internal clock.

toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

state
State state;
Undocumented in source.

Meta