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 Summary
Modifier and TypeMethodDescriptionvoidThis method must be called to end the stream task when all actions for the tasks have been performed.Same assuspendDefaultAction(PeriodTimer)but without any associated timer measuring the idle time.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.
-
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
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)PeriodTimerthat 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 assuspendDefaultAction(PeriodTimer)but without any associated timer measuring the idle time.
-