add method
Future<FdHandler>
add({
- required int fd,
- required Set<
EpollFlag> events, - required FdReadyCallback isolateCallback,
- required dynamic isolateCallbackContext,
- required ValueCallback onValue,
- required ErrorCallback onError,
Implementation
Future<FdHandler> add({
required int fd,
required Set<EpollFlag> events,
required FdReadyCallback isolateCallback,
required dynamic isolateCallbackContext,
required ValueCallback onValue,
required ErrorCallback onError,
}) async {
assert(_alive);
final seq = Capability();
final handler = _FdHandlerImpl(
fd: fd,
callback: onValue,
errorCallback: onError,
);
await _sendCmd(_AddCmd(
seq: seq,
listenerIdentity: handler._id,
fd: fd,
flags: events,
callback: isolateCallback,
callbackContext: isolateCallbackContext,
));
_handlers[handler._id] = handler;
return handler;
}