Package net.engio.mbassy.bus.publication
Class SyncAsyncPostCommand<T>
- java.lang.Object
-
- net.engio.mbassy.bus.publication.SyncAsyncPostCommand<T>
-
- All Implemented Interfaces:
IPublicationCommand
,ISyncAsyncPublicationCommand
public class SyncAsyncPostCommand<T> extends java.lang.Object implements ISyncAsyncPublicationCommand
This post command provides access to standard synchronous and asynchronous dispatch
-
-
Constructor Summary
Constructors Constructor Description SyncAsyncPostCommand(MBassador<T> mBassador, T message)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IMessagePublication
asynchronously()
Execute the message publication asynchronously.IMessagePublication
asynchronously(long timeout, java.util.concurrent.TimeUnit unit)
Execute the message publication asynchronously.IMessagePublication
now()
Execute the message publication immediately.
-
-
-
Method Detail
-
now
public IMessagePublication now()
Description copied from interface:IPublicationCommand
Execute the message publication immediately. This call blocks until every matching message handler has been invoked.- Specified by:
now
in interfaceIPublicationCommand
-
asynchronously
public IMessagePublication asynchronously()
Description copied from interface:ISyncAsyncPublicationCommand
Execute the message publication asynchronously. The behaviour of this method depends on the configured queuing strategy: If an unbound queuing strategy is used the call returns immediately. If a bounded queue is used the call might block until the message can be placed in the queue.- Specified by:
asynchronously
in interfaceISyncAsyncPublicationCommand
- Returns:
- A message publication that can be used to access information about the state of
-
asynchronously
public IMessagePublication asynchronously(long timeout, java.util.concurrent.TimeUnit unit)
Description copied from interface:ISyncAsyncPublicationCommand
Execute the message publication asynchronously. The behaviour of this method depends on the configured queuing strategy: If an unbound queuing strategy is used the call returns immediately. If a bounded queue is used the call will block until the message can be placed in the queue or the timeout is reached.- Specified by:
asynchronously
in interfaceISyncAsyncPublicationCommand
- Returns:
- A message publication that wraps up the publication request
-
-