An Orchestrator executes a set of, possibly dependent, Tasks.
An Orchestrator executes a set of, possibly dependent, Tasks.
A task corresponds to sending a message to an actor, handling its response and possibly
mutate the internal state of the Orchestrator.
The Orchestrator together with the Task is able to:
DistinctIdsOrchestrator ensures each destination
will see an independent strictly monotonically increasing sequence number without gaps.NOTE: the responses that are received must be Serializable.
In order for the Orchestrator and the Tasks to be able to achieve all of this they have to access and modify each others state directly. This means they are very tightly coupled with each other. To make this relation more obvious and to enforce it, you will only be able to create tasks if you have a reference to an orchestrator (which is passed implicitly to a task).
If you have the need to refactor the creation of tasks so that you can use them in multiple orchestrators you can leverage self type annotations.
the type of result this orchestrator returns when it finishes.
A MinimumVotes function where at least n votes are needed to achieve a quorum.
In a DistinctIdsOrchestrator an independent sequence is used for each destination of the orchestrator.
In a DistinctIdsOrchestrator an independent sequence is used for each destination of the orchestrator. In this orchestrator the delivery id is not sufficient to disambiguate which task should handle the message, so the ID = CorrelationId and the matchId also needs to check the sender. There is also the added necessity of being able to compute the correlation id for a given (sender, deliveryId) as well as translating a correlation id back to a delivery id.
A full task represents a task plus its dependencies.
A full task represents a task plus its dependencies. It ensures a Task is only created when all of its dependencies have finished.
the result type of this task.
the type of the dependencies HList.
A function that calculates how many votes are needed to achieve a quorum, given the number of destinations.
In a simple orchestrator the same sequence number (of akka-persistence) is used for all the destinations of the orchestrator.
In a simple orchestrator the same sequence number (of akka-persistence) is used for all the destinations of the orchestrator. Because of this, ID = DeliveryId, and matchId only checks the deliveryId as that will be enough information to disambiguate which task should handle the response.
An immutable representation (a report) of a Task in a given moment of time.
An immutable representation (a report) of a Task in a given moment of time.
the type of the result.
the task index this report pertains to.
a text that describes the task in a human readable way. Or a message key to be used in internationalization.
the indexes of the tasks that must have finished in order for the task to be able to start.
the current state of the task.
the destination of the task. If the task hasn't started this will be a None.
the result of the task. If the task hasn't finished this will be a None.
This class holds all the settings that parameterize akkastrator.
This class holds all the settings that parameterize akkastrator.
If you would like to create an instance of settings from a typesafe config invoke Settings.fromConfig.
A task corresponds to sending a message to an actor, handling its response and possibly mutate the internal state of its Orchestrator.
A task corresponds to sending a message to an actor, handling its response and possibly mutate the internal state of its Orchestrator.
The answer(s) to the sent message must be handled in behavior. behavior must invoke finish when
no further processing is necessary. Or abort if the received message will prevent subsequent
tasks from executing properly.
The pattern matching inside behavior must invoke matchId to ensure the received message
is in fact the one that this task its waiting to receive.
The internal state of the orchestrator might be mutated inside behavior.
This class is very tightly coupled with Orchestrator and the reverse is also true. See AbstractOrchestrator for more details on why that is the case.
the return type of this Task.
A task that creates a variable number of tasks and succeeds when all the created tasks finish successfully.
A task that creates a variable number of tasks and succeeds when all the created tasks finish successfully. The return type of the tasks must be the same. Their messages and destinations are unrestrained.
This task is specially useful to create n tasks where n is computed from the result of another task.
the return type of the tasks created using tasksCreator.
A task that creates a variable number of tasks and succeeds when n tasks finish producing the same result.
A task that creates a variable number of tasks and succeeds when n tasks finish producing the same result.
n is calculated with the minimumVotes function.
The return type and the message of the tasks must be the same. And their destinations must be different.
The last two restrictions are validated in runtime when the quorum is created. If they fail the task will abort.
To validate the messages are the same, each task message is compared via != against the other tasks messages.
In order for this task to work correctly either: · The created orchestrator must send to its parent a Orchestrator.Success when it finishes and a Orchestrator.Failure when it aborts.
In order for this task to work correctly either: · The created orchestrator must send to its parent a Orchestrator.Success when it finishes and a Orchestrator.Failure when it aborts. And terminate afterwords of sending the messages. · Or the method behavior must be overridden to handle the messages the inner orchestrator sends when it terminates or aborts.
the return type of this Task. Also the return type of the spawned orchestrator.
the type of AbstractOrchestrator the Props must create.
A MinimumVotes function where all the votes are needed to achieve a quorum.
A MinimumVotes function where a majority of votes are needed to achieve a quorum.
Exception used to abort waiting tasks when the quorum was already achieved.
Signals that the quorum is impossible to achieve since enough tasks have aborted that prevent the orchestrator from achieving enough votes to satisfy the minimumVotes function.
Signals that every task in the Quorum has finished but a quorum has not achieved.