Class SyncAsyncPostCommand<T>

java.lang.Object
net.engio.mbassy.bus.publication.SyncAsyncPostCommand<T>
All Implemented Interfaces:
IPublicationCommand, ISyncAsyncPublicationCommand

public class SyncAsyncPostCommand<T> extends Object implements ISyncAsyncPublicationCommand
This post command provides access to standard synchronous and asynchronous dispatch
  • Field Details

    • message

      private T message
    • mBassador

      private MBassador<T> mBassador
  • Constructor Details

    • SyncAsyncPostCommand

      public SyncAsyncPostCommand(MBassador<T> mBassador, T message)
  • Method Details

    • 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 interface IPublicationCommand
    • 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 interface ISyncAsyncPublicationCommand
      Returns:
      A message publication that can be used to access information about the state of
    • asynchronously

      public IMessagePublication asynchronously(long timeout, 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 interface ISyncAsyncPublicationCommand
      Returns:
      A message publication that wraps up the publication request