Interface | Description |
---|---|
Callback<IN,OUT> |
Interface for a javascript/node.js like callback (and chain)
Warning: The generics
|
Callback.ProducesMore<IN,OUT,MORE> |
Implement this (rare) if your callback produces "more" than a single output
This will be used by a single followup callback as its more...
|
Callback.ProducesMultiple<IN,OUT> |
Implement this if your callback produces multiple single outputs
to be used by multiple followup callbacks as their IN argument.
|
Class | Description |
---|---|
AbstractCallback<IN,OUT> |
Abstract implementation of a Callback, which also implements Emit.IListener.
Subclasses need only implement callback(). |
AbstractCallback.Canned<IN,OUT> |
Inner class mainly for tests, allows for canned results
|
AbstractCallback.NOP<IN> |
Class that does nothing (just calls failFast), then returns input unchanged
|
CallbackAnd |
Immutable Utility classes/data-structures to group a Callback with associated inputs, outputs, or exceptions
Input and Output are package visible, and are used internally by Callbacks and/or CallbackExecutor |
CallbackExecutor |
Class to execute callbacks, and manage their links, using two ExecutorServices
|
Callbacks |
Utilities for dealing with Callbacks
|
Exception | Description |
---|---|
CallbackAnd.Xception |
Represents an Exception thrown by a Callback
Unlike the two others this is public cause users might want to catch it
|
Code for using and linking together callbacks, inspired by node.js / javascript Due to language differences (this isn't written for Java 8) it is only a quasi-port. Though many of the classes are generified as aids to documentation, ultimately there are unchecked casts involved, so if you listen for a String but get a Date bad things will happen.
Typical Usage: