FileSystemEvent

Undocumented in source.

Constructors

this
this(Notifier notifier)

Constructor. Creates a custom event and hooks it up to the provided event notifier which in addition accepts the name field.

Members

Aliases

Notifier
alias Notifier = void delegate(RaisedEvent)

Alias for the notifier delegate that receives the event as a smart union.

RaisedEvent
alias RaisedEvent = SmartUnion!(EventUnion)

SmartUnion alias for the possible events that could happen.

Functions

events
Event events()
fileHandle
Handle fileHandle()

Required by ISelectable interface.

handle
bool handle(Event event)

Event handler, invoked by the epoll select dispatcher.

setNotifier
void setNotifier(Notifier notifier)

Replace the notifier delegate

unwatch
bool unwatch(char[] path)

Stops watching the specified path. The handler delegate will no longer be called when events on this path occur.

watch
void watch(char[] path, FileEventsEnum events)

Adds or updates the events being watched for the specified path. The handler delegate previously specified will be called when one of the watched events occurs.

Structs

DirectoryFileEvent
struct DirectoryFileEvent

Structure carrying path, name and event, representing event that happened on a file in a watched directory.

FileEvent
struct FileEvent

Structure carrying only path and event.

Unions

EventUnion
union EventUnion

Union of possible events that could happen.

Inherited Members

From ISelectClient

ISelectable
alias ISelectable = .ISelectable

Convenience alias to avoid public imports

Event
alias Event = Epoll.Event

Enum of event types

FinalizeStatus
enum FinalizeStatus

Enum of the status when finalize() is called.

fileHandle
Handle fileHandle()

I/O device instance

events
Event events()

Events to register the conduit for.

timeout_us
ulong timeout_us;

Connection time out in microseconds. Effective only when used with an EpollSelectDispatcher which has timeouts enabled. A value of 0 has no effect.

expiry_registration
IExpiryRegistration expiry_registration(IExpiryRegistration expiry_registration_)

Sets the timeout manager expiry registration.

timed_out
bool timed_out()
handle
bool handle(Event event)

I/O event handler

timeout
void timeout()

Timeout method, called after a timeout occurs in the SelectDispatcher eventLoop. Intended to be overridden by a subclass if required.

finalize
void finalize(FinalizeStatus status)

Finalize method, called after this instance has been unregistered from the Dispatcher. Intended to be overridden by a subclass if required.

error
void error(Exception exception, Event event)

Error reporting method, called when an Exception is caught from handle(). Calls the error_() method, which should be overridden by a subclass if required.

error_
void error_(Exception exception, Event event)
Undocumented in source. Be warned that the author may not have intended to support it.
error_code
int error_code()

Obtains the current error code of the underlying I/O device.

registered
void registered()

Register method, called after this client is registered with the SelectDispatcher. Intended to be overridden by a subclass if required.

unregistered
void unregistered()

Unregister method, called after this client is unregistered from the SelectDispatcher. Intended to be overridden by a subclass if required.

is_registered
bool is_registered()

Returns true if this.conduit is currently registered for this.events with this as attachment. Returns false if this.conduit is not registered with epoll or, when multiple instances of this class share the same conduit, if it is registered with another instance.

timeout_value_us
ulong timeout_value_us()

ISelectClientInfo method.

registered_
void registered_()

Called by registered(); may be overridden by a subclass.

unregistered_
void unregistered_()

Called by unregistered(); may be overridden by a subclass.

id
cstring id()

Returns an identifier string of this instance. Defaults to the name of the class, but may be overridden if more detailed information is required.

toString
istring toString()

Returns a string describing this client, for use in debug messages.

fmtInfo
void fmtInfo(void delegate(cstring chunk) sink)

Produces a string containing information about this instance: Dynamic type, file descriptor and events.

Meta