folly::EventHandler

The EventHandler class is used to asynchronously wait for events on a file descriptor.

Synopsis

Declared in <folly/io/async/EventHandler.h>

class EventHandler;

Description

Users that wish to wait on I/O events should derive from EventHandler and implement the handlerReady() method.

Enums

NameDescription
EventFlags Bitset flags describing the I/O events a handler can wait for.

Member Functions

NameDescription
EventHandler [constructor]Constructors
~EventHandler [destructor] [virtual]EventHandler destructor.
operator= [deleted]Deleted copy assignment; EventHandler objects are not copyable.
activateEvent Make an event active.
attachEventBase Attach the handler to a EventBase.
changeHandlerFD Change the file descriptor that this handler is associated with.
detachEventBase Detach the handler from its EventBase.
getRegisteredEvents Return the set of events that we're currently registered for.
handlerReady [virtual]handlerReady() is invoked when the handler is ready.
initHandler Attach the handler to a EventBase, and change the file descriptor.
isHandlerRegistered Returns true if the handler is currently registered.
isPending Returns true if the handler is registered but has not yet fired.
registerHandler Register the handler.
registerInternalHandler Register the handler as an internal event.
setEdgeTriggered If supported by the backend updates the event to be edge-triggered. Returns true iff the update was successful.
unregisterHandler Unregister the handler, if it is registered.

Derived Classes

NameDescription
AsyncPipeReader Read from a pipe in an async manner.
AsyncPipeWriter Write to a pipe in an async manner.
AsyncUDPSocket UDP socket
IoHandler Event handler that dispatches fd readiness events to the socket.
SimpleAsyncIO SimpleAsyncIO is a wrapper around AsyncIO intended to hide all the details.
TimerFD