FileEventDispatcher

Since the lowest level event for files only allows one handler, but can send events that require a variety of different responses, the FileEventDispatcher is available to make this easer.

Instead of filtering yourself, you can add files to one of these with handlers for read, write, and error on that specific handle. These handlers must take either zero arguments or exactly one argument, which will be the file being handled.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Enums

HandlerDuty
enum HandlerDuty

What should this default handler work on?

Functions

addFile
void addFile(FileType handle, ReadEventHandler readEventHandler, WriteEventHandler writeEventHandler, ErrorEventHandler errorEventHandler, bool edgeTriggered)

You can add a file to listen to here. Files can be OS handles or Phobos types. The handlers can be null, meaning use the default (see: setDefaultHandler), or callables with zero or one argument. If they take an argument, it will be the file being handled at this time.

setDefaultHandler
void setDefaultHandler(HandlerDuty duty, T handler)

Sets a default handler, used for file events where the custom handler on addFile was null

Suggestion Box / Bug Report