ref_send API 2.9
defensive programming in Java

org.ref_send.promise
Interface Resolver<T>

Type Parameters:
T - promised referent type
All Superinterfaces:
Receiver<T>

public interface Resolver<T>
extends Receiver<T>

A Promise resolver.


Method Summary
 void apply(T referent)
          Resolve the corresponding promise to the given reference.
 void progress()
          Logs progress towards resolution.
 void reject(java.lang.Exception reason)
          Put the corresponding promise in the rejected state.
 void resolve(Promise<T> promise)
          Resolve the corresponding promise to the given promise.
 

Method Detail

apply

void apply(T referent)
Resolve the corresponding promise to the given reference.

This method is syntactic sugar for:

 resolve(ref(referent));
 

Specified by:
apply in interface Receiver<T>
Parameters:
referent - resolved value of the corresponding promise

reject

void reject(java.lang.Exception reason)
Put the corresponding promise in the rejected state.

This method is syntactic sugar for:

 resolve(reject(reason));
 

Parameters:
reason - reason the corresponding promise will not be fulfilled

resolve

void resolve(Promise<T> promise)
Resolve the corresponding promise to the given promise.

Parameters:
promise - promise to forward requests to

progress

void progress()
Logs progress towards resolution.


ref_send API 2.9
defensive programming in Java

Submit a bug or feature, or get help

Copyright 1998-2009 Waterken Inc. under the terms of the MIT X license.