Class AsyncResultHandler<T>

  • Type Parameters:
    T - the type of result handled
    All Implemented Interfaces:
    ResultHandler<T,​CoreTokenException>

    public class AsyncResultHandler<T>
    extends Object
    implements ResultHandler<T,​CoreTokenException>
    AsyncResultHandler is an asynchronous implementation of the ResultHandler. It specifically is aware of the threading and timing concerns around asynchronous operations and mitigates that with the use of a BlockingQueue. The processed result is placed on the queue when available. At which point either the caller is already waiting, or can begin to wait for the result. The queue is sized to one to enforce the usage of this ResultHandler as being used only once.