Selectable

Undocumented in source.

Members

Functions

error
void error()

Notify the selectable that an error has occurred.

expired
void expired()

Notify the selectable that it has expired.

free
void free()

Notify the selectable that it has been free'd.

getDeadline
long getDeadline()

@return a deadline after which this selectable can expect to receive a notification (via the {@link #expired()} method that indicates that the deadline has past. The deadline is expressed in the same format as {@link System#currentTimeMillis()}. Returning a deadline of zero (or a negative number) indicates that the selectable does not wish to be notified of expiry.

getReactor
Reactor getReactor()

@return the reactor to which this selectable is a child.

isReading
bool isReading()

@return <code>true</code> if the selectable is interested in receiving notification (via the {@link #readable()} method that indicate that the associated {@link SelectableChannel} has data ready to be read from it.

isRegistered
bool isRegistered()

Check if a selectable is registered. This can be used for tracking whether a given selectable has been registerd with an external event loop. <p> <em>Note:</em> the reactor code, currently, does not use this flag. @return <code>true</code>if the selectable is registered.

isTerminal
bool isTerminal()

@return <code>true</code> if the selectable has reached a terminal state.

isWriting
bool isWriting()

@return <code>true</code> if the selectable is interested in receiving notifications (via the {@link #writeable()} method that indicate that the associated {@link SelectableChannel} is ready to be written to.

onError
void onError(Callback runnable)

Registers a callback that will be run when the selectable is notified of an error. @param runnable the callback to register. Any previously registered callback will be replaced.

onExpired
void onExpired(Callback runnable)

Registers a callback that will be run when the selectable expires. @param runnable the callback to register. Any previously registered callback will be replaced.

onFree
void onFree(Callback runnable)

Registers a callback that will be run when the selectable is notified that it has been free'd. @param runnable the callback to register. Any previously registered callback will be replaced.

onReadable
void onReadable(Callback runnable)

Registers a callback that will be run when the selectable becomes ready for reading. @param runnable the callback to register. Any previously registered callback will be replaced.

onRelease
void onRelease(Callback runnable)

Registers a callback that will be run when the selectable is notified that it has been released. @param runnable the callback to register. Any previously registered callback will be replaced.

onWritable
void onWritable(Callback runnable)

Registers a callback that will be run when the selectable becomes ready for writing. @param runnable the callback to register. Any previously registered callback will be replaced.

readable
void readable()

Notify the selectable that the underlying {@link SelectableChannel} is ready for a read operation.

release
void release()

Notify the selectable that it has been released.

setCollector
void setCollector(Collector collector)

Configure a selectable with a set of callbacks that emit readable, writable, and expired events into the supplied collector. @param collector

setDeadline
void setDeadline(long deadline)

Sets the value that will be returned by {@link #getDeadline()}. @param deadline

setReading
void setReading(bool reading)

Sets the value that will be returned by {@link #isReading()}. @param reading

setRegistered
void setRegistered(bool registered)

Set the registered flag for a selectable. <p> <em>Note:</em> the reactor code, currently, does not use this flag. @param registered the value returned by {@link #isRegistered()}

setWriting
void setWriting(bool writing)

Sets the value that will be returned by {@link #isWriting()}. @param writing

terminate
void terminate()

Terminates the selectable. Once a selectable reaches a terminal state it will never be interested in events of any kind.

writeable
void writeable()

Notify the selectable that the underlying {@link SelectableChannel} is ready for a write operation.

Inherited Members

From ReactorChild

free
void free()

Frees any resources associated with this child.

opCmp
int opCmp(ReactorChild o)
Undocumented in source.

From Extendable

attachments
Record attachments()
Undocumented in source.

Meta