EventLoop

Event handlers can be registered to the event loop by being run(), all events associated with them will trigger the OS to resume the underlying thread which enables the existence of all the asynchroneous event objects in this library.

final
class EventLoop {}

Constructors

this
this()

Members

Functions

accept
AsyncUDSConnection accept(AsyncUDSListener ctxt)
Undocumented in source. Be warned that the author may not have intended to support it.
bind
bool bind(AsyncSocket ctxt, sockaddr* addr, socklen_t addrlen)
Undocumented in source. Be warned that the author may not have intended to support it.
broadcast
bool broadcast(fd_t fd, bool b)
Undocumented in source. Be warned that the author may not have intended to support it.
closeSocket
bool closeSocket(fd_t fd, bool connected, bool listener)
Undocumented in source. Be warned that the author may not have intended to support it.
connect
bool connect(AsyncSocket ctxt, sockaddr* addr, socklen_t addrlen)
Undocumented in source. Be warned that the author may not have intended to support it.
exit
void exit()

Call this to cleanup underlying OS resources. The implementation is currently incomplete and requires the process to be shut down for the resources to be collected automatically. Used as a placeholder in the meantime.

kill
bool kill(AsyncEvent obj, bool forced)
Undocumented in source. Be warned that the author may not have intended to support it.
kill
bool kill(AsyncDirectoryWatcher obj)
Undocumented in source. Be warned that the author may not have intended to support it.
kill
bool kill(AsyncSocket obj, bool forced)
Undocumented in source. Be warned that the author may not have intended to support it.
kill
bool kill(AsyncTCPConnection obj, bool forced)
Undocumented in source. Be warned that the author may not have intended to support it.
kill
bool kill(AsyncTCPListener obj)
Undocumented in source. Be warned that the author may not have intended to support it.
kill
bool kill(AsyncSignal obj)
Undocumented in source. Be warned that the author may not have intended to support it.
kill
bool kill(AsyncNotifier obj)
Undocumented in source. Be warned that the author may not have intended to support it.
kill
bool kill(AsyncTimer obj)
Undocumented in source. Be warned that the author may not have intended to support it.
kill
bool kill(AsyncUDPSocket obj)
Undocumented in source. Be warned that the author may not have intended to support it.
listen
bool listen(AsyncSocket ctxt, int backlog)
Undocumented in source. Be warned that the author may not have intended to support it.
localAddr
NetworkAddress localAddr(fd_t fd, bool ipv6)
Undocumented in source. Be warned that the author may not have intended to support it.
loop
bool loop(Duration max_timeout)

Runs the event loop once and returns false if a an unrecoverable error occured Using a value of 0 will return immediately, while a value of -1.seconds will block indefinitely

notify
bool notify(fd_t fd, T payload)
Undocumented in source. Be warned that the author may not have intended to support it.
read
uint read(fd_t fd, ubyte[] data)
Undocumented in source. Be warned that the author may not have intended to support it.
readChanges
uint readChanges(fd_t fd, DWChangeInfo[] dst)
Undocumented in source. Be warned that the author may not have intended to support it.
recv
uint recv(fd_t fd, ubyte[] data)
Undocumented in source. Be warned that the author may not have intended to support it.
recvFrom
uint recvFrom(fd_t fd, ubyte[] data, NetworkAddress addr)
Undocumented in source. Be warned that the author may not have intended to support it.
resolveHost
NetworkAddress resolveHost(string host, ushort port, isIPv6 ipv6, isTCP tcp, isForced force)

Blocks until the hostname is resolved, unless it's invalid.

resolveIP
NetworkAddress resolveIP(string ip, ushort port, isIPv6 ipv6, isTCP tcp, isForced force)
run
bool run(AsyncEvent ctxt, EventHandler del)
Undocumented in source. Be warned that the author may not have intended to support it.
run
fd_t run(AsyncTCPConnection ctxt, TCPEventHandler del)
Undocumented in source. Be warned that the author may not have intended to support it.
run
fd_t run(AsyncTCPListener ctxt, TCPAcceptHandler del)
Undocumented in source. Be warned that the author may not have intended to support it.
run
fd_t run(AsyncUDSConnection ctxt)
Undocumented in source. Be warned that the author may not have intended to support it.
run
fd_t run(AsyncUDSListener ctxt)
Undocumented in source. Be warned that the author may not have intended to support it.
run
fd_t run(AsyncSocket ctxt)
Undocumented in source. Be warned that the author may not have intended to support it.
run
fd_t run(AsyncSignal ctxt)
Undocumented in source. Be warned that the author may not have intended to support it.
run
fd_t run(AsyncNotifier ctxt)
Undocumented in source. Be warned that the author may not have intended to support it.
run
fd_t run(AsyncTimer ctxt, TimerHandler del, Duration timeout)
Undocumented in source. Be warned that the author may not have intended to support it.
run
fd_t run(AsyncUDPSocket ctxt, UDPHandler del)
Undocumented in source. Be warned that the author may not have intended to support it.
run
fd_t run(AsyncDirectoryWatcher ctxt, DWHandler del)
Undocumented in source. Be warned that the author may not have intended to support it.
send
uint send(fd_t fd, ubyte[] data)
Undocumented in source. Be warned that the author may not have intended to support it.
sendTo
uint sendTo(fd_t fd, ubyte[] data, NetworkAddress addr)
Undocumented in source. Be warned that the author may not have intended to support it.
setOption
bool setOption(fd_t fd, TCPOption option, T val)
Undocumented in source. Be warned that the author may not have intended to support it.
submitRequest
void submitRequest(AsyncAcceptRequest* ctxt)
Undocumented in source. Be warned that the author may not have intended to support it.
submitRequest
void submitRequest(AsyncReceiveRequest* ctxt)
Undocumented in source. Be warned that the author may not have intended to support it.
submitRequest
void submitRequest(AsyncSendRequest* ctxt)
Undocumented in source. Be warned that the author may not have intended to support it.
unwatch
bool unwatch(fd_t fd, fd_t wd)
Undocumented in source. Be warned that the author may not have intended to support it.
watch
uint watch(fd_t fd, WatchInfo info)
Undocumented in source. Be warned that the author may not have intended to support it.
write
uint write(fd_t fd, ubyte[] data)
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

error
string error [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
status
StatusInfo status [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

m_asyncThreadsStarted
bool m_asyncThreadsStarted;
Undocumented in source.
m_evLoop
EventLoopImpl m_evLoop;
Undocumented in source.

Meta