com.stumbleupon.async
Interface Callback<R,T>

Type Parameters:
R - The return type of the callback.
T - The argument type of the callback.

public interface Callback<R,T>

A simple 1-argument callback interface.

Callbacks are typically created as anonymous classes. In order to make debugging easier, it is recommended to override the Object.toString() method so that it returns a string that briefly explains what the callback does. If you use Deferred with DEBUG logging turned on, this will be really useful to understand what's in the callback chains.


Field Summary
static Callback<Object,Object> PASSTHROUGH
          The identity function (returns its argument).
 
Method Summary
 R call(T arg)
          The callback.
 

Field Detail

PASSTHROUGH

static final Callback<Object,Object> PASSTHROUGH
The identity function (returns its argument).

Method Detail

call

R call(T arg)
       throws Exception
The callback.

Parameters:
arg - The argument to the callback.
Returns:
The return value of the callback.
Throws:
Exception - any exception.