Packagecom.kaazing.gateway.jms.client
Classpublic class MessageFuture
InheritanceMessageFuture Inheritance com.kaazing.gateway.jms.client.GenericFuture

Future-based support for asynchronous functions returning a value. Methods that would block instead accept a callback which is called when its execution completes asynchronously. Once the callback is invoked, call get() to fetch the value. Any errors that were caught during execution of the asynchronous function will be thrown from get() and checkError().



Public Methods
 MethodDefined by
  
MessageFuture(callback:Function = null)
Future-based support for asynchronous functions returning a value.
MessageFuture
  
checkError():void
Throws any errors caught during the execution of the asynchronous method.
MessageFuture
  
fulfill(message:Message):void
Called when the future has completed execution.
MessageFuture
  
Returns the result of the function executed.
MessageFuture
Constructor detail
MessageFuture()constructor
public function MessageFuture(callback:Function = null)

Future-based support for asynchronous functions returning a value. Methods that would block instead accept a callback which is called when its execution completes asynchronously. Once the callback is invoked, call get() to fetch the value. Any errors that were caught during execution of the asynchronous function will be thrown from get() and checkError().

Parameters
callback:Function (default = null)
Method detail
checkError()method
public function checkError():void

Throws any errors caught during the execution of the asynchronous method.

fulfill()method 
public function fulfill(message:Message):void

Called when the future has completed execution. Calls to fulfill() should only be made to indicate completion of a function call.

Parameters
message:Message
get()method 
public function get():Message

Returns the result of the function executed. This should be called only after the future is fulfilled, for example, from within the function body of a callback passed to an asynchronous method.

Returns
Message