Package

pt.tecnico.dsi

akkastrator

Permalink

package akkastrator

Visibility
  1. Public
  2. All

Type Members

  1. trait Orchestrator extends PersistentActor with ActorLogging with AtLeastOnceDelivery

    Permalink

    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:

    • Handling the persistence of the internal state maintained by both the Orchestrator and the Tasks.
    • Delivering messages with at-least-once delivery guarantee.
    • Handling Status messages, that is, if some actor is interested in querying the Orchestrator for its current status, the Orchestrator will respond with the status of each task.
    • Tasks that have no dependencies will be started right away and the Orchestrator will, from that point onwards, be prepared to handle the responses to the sent messages.
    • If the Orchestrator crashes, the state it maintains will be correctly restored.

    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/or modify each others state directly. This means they are very tightly coupled with each other.

  2. case class Status(id: Long) extends Product with Serializable

    Permalink
  3. case class StatusResponse(tasks: Seq[TaskStatus], id: Long) extends Product with Serializable

    Permalink
  4. abstract class Task extends AnyRef

    Permalink

    A task corresponds to sending a message to an actor, handling its response and possibly mutate the internal state of the Orchestrator.

    A task corresponds to sending a message to an actor, handling its response and possibly mutate the internal state of the Orchestrator. The answer(s) to the sent message must be handled in behavior. behavior must invoke finish when no further processing is necessary. The pattern matching inside behavior should invoke matchSenderAndID to ensure the received message is in fact the one that we were waiting to receive. The internal state of the orchestrator might be mutated inside behavior.

    This class is super tightly coupled with Orchestrator and the reverse is also true.

    This class changes the internal state of the orchestrator:

    • The task constructor adds the constructed task to the tasks variable.
    • Inside behavior the internal state of the orchestrator may be changed.
    • If all tasks are finished the orchestrator will be stopped.
    • Otherwise, the next behavior of the orchestrator will be computed.

    In exchange the orchestrator changes the internal state of the task:

    • By invoking start which changes the task status to Waiting.
  5. case class TaskStatus(index: Int, description: String, status: Task.Status, dependencies: Set[Int]) extends Product with Serializable

    Permalink

Value Members

  1. object Orchestrator

    Permalink
  2. object Task

    Permalink

Ungrouped