Interface MailboxDefaultAction.Controller
-
- All Known Implementing Classes:
MailboxProcessor.MailboxController
- Enclosing interface:
- MailboxDefaultAction
@Internal public static interface MailboxDefaultAction.ControllerThis 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidallActionsCompleted()This method must be called to end the stream task when all actions for the tasks have been performed.MailboxDefaultAction.SuspensionsuspendDefaultAction()Same assuspendDefaultAction(PeriodTimer)but without any associated timer measuring the idle time.MailboxDefaultAction.SuspensionsuspendDefaultAction(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 Detail
-
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)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.
-
-