Interface MailboxDefaultAction.Controller

All Known Implementing Classes:
MailboxProcessor.MailboxController
Enclosing interface:
MailboxDefaultAction

@Internal public static interface MailboxDefaultAction.Controller
This controller is a feedback interface for the default action to interact with the mailbox execution. In particular, it offers ways to signal that the execution of the default action should be finished or temporarily suspended.
  • Method Details

    • allActionsCompleted

      void allActionsCompleted()
      This method must be called to end the stream task when all actions for the tasks have been performed. This method can be invoked from any thread.
    • suspendDefaultAction

      MailboxDefaultAction.Suspension suspendDefaultAction(PeriodTimer suspensionPeriodTimer)
      Calling this method signals that the mailbox-thread should (temporarily) stop invoking the default action, e.g. because there is currently no input available. This method must be invoked from the mailbox-thread only!
      Parameters:
      suspensionPeriodTimer - started (ticking) PeriodTimer that measures how long the default action was suspended/idling. If mailbox loop is busy processing mails, this timer should be paused for the time required to process the mails.
    • suspendDefaultAction

      MailboxDefaultAction.Suspension suspendDefaultAction()
      Same as suspendDefaultAction(PeriodTimer) but without any associated timer measuring the idle time.