Class AsynchronousProcessor<K,V,R>

java.lang.Object
com.tangosol.util.AsynchronousAgent<Map<K,R>>
com.tangosol.util.processor.AbstractAsynchronousProcessor<K,V,R,Map<K,R>>
com.tangosol.util.processor.AsynchronousProcessor<K,V,R>
Type Parameters:
K - the type of the Map entry key
V - the type of the Map entry value
R - the type of value returned by the EntryProcessor
All Implemented Interfaces:
FlowControl, InvocableMap.EntryProcessor<K,V,R>, Serializable, Future<Map<K,R>>
Direct Known Subclasses:
ContinuousQueryCache.ConverterAsynchronousProcessor

public class AsynchronousProcessor<K,V,R> extends AbstractAsynchronousProcessor<K,V,R,Map<K,R>>
An EntryProcessor wrapper class that allows for an asynchronous invocation of the underlying processor. When used as a Future (without extending), this implementation will collect the results of asynchronous invocation into a Map, providing the result semantics identical to the EntryProcessor.processAll contract.

More advanced use would require extending this class and overriding onResult(java.util.Map.Entry<K, R>), onComplete(), and onException(java.lang.Throwable) methods.

It is very important that the overriding implementations of these methods must be non-blocking. For example, any use of NamedCache API is completely disallowed, with the only exception of asynchronous agents.

The underlying entry processor is guaranteed to have been fully executed when onComplete() is called.

Note 1: Neither this class nor its extensions need to be serializable. Only the underlying processor is serialized and sent to corresponding servers for execution.
Note 2: This feature is not available on Coherence*Extend clients.

Author:
gg/mf 2012.12.21
See Also:
  • Field Details

    • m_eReason

      protected volatile Throwable m_eReason
      Reason for the failed operation.
    • m_listResultEntries

      protected List<Map.Entry<K,R>> m_listResultEntries
      List of result value entries. The reason we keep the result entries as a List rather than a Set or a Map is to skip unnecessary "equals" checks and defer potentially unneeded deserialization.
  • Constructor Details

  • Method Details