EventLoop.registerIo

Token registerIo(Handle handle, IoInterest interest, IoWatcherCallback callback, WatcherFlags extraFlags = WatcherFlags.none) @trusted nothrow

Register an I/O watcher with the selected backend.

When EventLoopConfig.edgeTriggeredDefault is true (the default), the watcher is registered with EPOLLET semantics. The callback must read (or write) until the syscall returns EAGAIN — partial drains will stall the connection because the kernel will not deliver a new event for data already buffered when the callback ran. Use drainToEAGAIN from eve.aio.posix.tcp for HTTP keep-alive style request parsing.

Parameters

handleNative handle to watch.
interestRequested readiness mask.
callbackCallback invoked for matching readiness events.

Returns

New watcher token on success, or Token.invalid with errno set.