LibasyncEventLoop

Undocumented in source.

Constructors

this
this()
Undocumented in source.

Members

Aliases

Listener
alias Listener = Tuple!(ServerImpl, "server", AsyncTCPListener, "listener")
Undocumented in source.
Timers
alias Timers = ResourcePool!(AsyncTimer, EventLoop_)
Undocumented in source.

Functions

addSignalHandler
void addSignalHandler(int sig, void delegate() handler)
Undocumented in source. Be warned that the author may not have intended to support it.
getAddressInfo
AddressInfo[] getAddressInfo(char[] host, char[] service, AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType, AddressInfoFlags addressInfoFlags)
Undocumented in source. Be warned that the author may not have intended to support it.
makeDatagramTransport
DatagramTransport makeDatagramTransport(Socket socket, DatagramProtocol datagramProtocol, Address remoteAddress, Waiter waiter)
Undocumented in source. Be warned that the author may not have intended to support it.
makeSocketTransport
Transport makeSocketTransport(Socket socket, Protocol protocol, Waiter waiter)
Undocumented in source. Be warned that the author may not have intended to support it.
removeSignalHandler
void removeSignalHandler(int sig)
Undocumented in source. Be warned that the author may not have intended to support it.
runForever
void runForever()
Undocumented in source. Be warned that the author may not have intended to support it.
scheduleCallback
void scheduleCallback(CallbackHandle callback)
Undocumented in source. Be warned that the author may not have intended to support it.
scheduleCallback
void scheduleCallback(Duration delay, CallbackHandle callback)
Undocumented in source. Be warned that the author may not have intended to support it.
scheduleCallback
void scheduleCallback(SysTime when, CallbackHandle callback)
Undocumented in source. Be warned that the author may not have intended to support it.
scheduleCallbackThreadSafe
void scheduleCallbackThreadSafe(CallbackHandle callback)
Undocumented in source. Be warned that the author may not have intended to support it.
socketConnect
void socketConnect(Socket socket, Address address)
Undocumented in source. Be warned that the author may not have intended to support it.
startServing
void startServing(ProtocolFactory protocolFactory, Socket socket, SslContext sslContext, ServerImpl server)
Undocumented in source. Be warned that the author may not have intended to support it.
stopServing
void stopServing(Socket socket)
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From EventLoop

State
enum State
Undocumented in source.
state
State state;
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.

isRunning
bool isRunning()
stop
void stop()

Stop running the event loop.

isClosed
bool isClosed()
close
void close()

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

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.

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

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

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().

time
SysTime time()

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

createTask
auto createTask(Coroutine coroutine, Args args)

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

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).

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.

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.

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).

getAddressInfo
AddressInfo[] getAddressInfo(char[] host, char[] service, AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType, AddressInfoFlags addressInfoFlags)
Undocumented in source.
addSignalHandler
void addSignalHandler(int sig, void delegate() handler)
Undocumented in source.
removeSignalHandler
void removeSignalHandler(int sig)
Undocumented in source.
setExceptionHandler
void setExceptionHandler(ExceptionHandler exceptionHandler)

Set handler as the new event loop exception handler.

defaultExceptionHandler
void defaultExceptionHandler(ExceptionContext exceptionContext)

Default exception handler.

callExceptionHandler
void callExceptionHandler(ExceptionContext exceptionContext)

Call the current event loop's exception handler.

toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.
scheduleCallback
void scheduleCallback(CallbackHandle callback)
Undocumented in source.
scheduleCallbackThreadSafe
void scheduleCallbackThreadSafe(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.
socketConnect
void socketConnect(Socket socket, Address address)
Undocumented in source.
makeSocketTransport
Transport makeSocketTransport(Socket socket, Protocol protocol, Waiter waiter)
Undocumented in source.
makeDatagramTransport
DatagramTransport makeDatagramTransport(Socket socket, DatagramProtocol datagramProtocol, Address remoteAddress, Waiter waiter)
Undocumented in source.
startServing
void startServing(ProtocolFactory protocolFactory, Socket socket, SslContext sslContext, ServerImpl server)
Undocumented in source.
stopServing
void stopServing(Socket socket)
Undocumented in source.

Meta