class TaskQuorum[R] extends TaskSpawnOrchestrator[R, Quorum[R]]

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.

Source
TaskQuorum.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TaskQuorum
  2. TaskSpawnOrchestrator
  3. Task
  4. AnyRef
  5. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TaskQuorum(task: FullTask[R, _])(minimumVotes: MinimumVotes, taskBuilders: Iterable[TaskBuilder[R]])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from TaskQuorum[R] to any2stringadd[TaskQuorum[R]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (TaskQuorum[R], B)
    Implicit
    This member is added by an implicit conversion from TaskQuorum[R] to ArrowAssoc[TaskQuorum[R]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def abort(cause: Throwable): Unit

    Aborts this task, which implies:

    Aborts this task, which implies:

    1. This task will change its state to Aborted. 2. Every unstarted task that depends on this one will never be started. This will happen because a task can only start if its dependencies have finished. 3. Waiting tasks or tasks which do not have this task as a dependency will remain untouched, unless the orchestrator is stopped or context.become is invoked in the onTaskAbort/onAbort callbacks of the orchestrator. 4. The method onTaskAbort will be invoked in the orchestrator. 5. The method onFinish in the orchestrator will never be invoked since this task did not finish.

    Aborting an already aborted task will throw an exception.

    cause

    what caused the abort to be invoked.

    Definition Classes
    Task
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def behavior: Receive

    The behavior of this task.

    The behavior of this task. This is akin to the receive method of an actor with the following exceptions: · An all catching pattern match is prohibited since it will cause the orchestrator to fail. · Every case must check if matchId returns true. This ensures the received message was in fact destined to this task. This choice of implementation allows the messages to have a free form, as it is the user that is responsible for extracting the id from the message. · Either finish or abort must be invoked after handling each response.

    Example of a well formed behavior:

    case Success(result, id) if matchId(id) =>
      orchestrator.state = // a new state
      finish("This task result") // The result is the value that the tasks that depend on this one will see.
    case SomethingWentWrong(why, id) if matchId(id) =>
      abort(why)
    case Timeout(id) =>
      abort(anError)
    Definition Classes
    TaskSpawnOrchestratorTask
  9. final def behaviorHandlingTimeout: Receive
    Definition Classes
    Task
  10. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  11. final def createMessage(id: Long): Serializable

    The constructor of the message to be sent.

    The constructor of the message to be sent. It must always return the same message, only the id must be different. If this Task is to be used inside a TaskQuorum then the created message should also implement equals.

    Definition Classes
    TaskSpawnOrchestratorTask
  12. final val destination: ActorPath

    The akka.actor.ActorPath to whom this task will send the message(s).

    The akka.actor.ActorPath to whom this task will send the message(s). This must be a value because the destination cannot change.

    Definition Classes
    TaskSpawnOrchestratorTask
  13. def ensuring(cond: (TaskQuorum[R]) ⇒ Boolean, msg: ⇒ Any): TaskQuorum[R]
    Implicit
    This member is added by an implicit conversion from TaskQuorum[R] to Ensuring[TaskQuorum[R]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: (TaskQuorum[R]) ⇒ Boolean): TaskQuorum[R]
    Implicit
    This member is added by an implicit conversion from TaskQuorum[R] to Ensuring[TaskQuorum[R]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: Boolean, msg: ⇒ Any): TaskQuorum[R]
    Implicit
    This member is added by an implicit conversion from TaskQuorum[R] to Ensuring[TaskQuorum[R]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. def ensuring(cond: Boolean): TaskQuorum[R]
    Implicit
    This member is added by an implicit conversion from TaskQuorum[R] to Ensuring[TaskQuorum[R]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  19. final def expectedID: Option[ID]
    Definition Classes
    Task
  20. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. final def finish(result: R): Unit

    Finishes this task, which implies:

    Finishes this task, which implies:

    1. This task will change its state to Finished. 2. Tasks that depend on this one will be started. 3. Re-sends from destination will no longer be handled by the orchestrator. If destinations re-sends its answer it will be logged as an unhandled message. 4. The method onTaskFinish will be invoked on the orchestrator.

    Finishing an already finished task will throw an exception.

    result

    the result this task will produce. This is the value that the tasks that depend on this one will see.

    Definition Classes
    Task
  22. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from TaskQuorum[R] to StringFormat[TaskQuorum[R]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  23. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  24. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  25. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  26. val log: LoggingAdapter
    Definition Classes
    Task
  27. final def matchId(id: Long): Boolean
    Definition Classes
    Task
  28. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  29. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  30. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  31. final def recoveryAwarePersist(event: Any)(handler: ⇒ Unit): Unit
    Definition Classes
    Task
  32. final def scheduleTimeout(id: ID): Unit
    Definition Classes
    Task
  33. final val spawner: ActorRef
    Definition Classes
    TaskSpawnOrchestrator
  34. final def start(): Unit
    Definition Classes
    Task
  35. final def state: State
    Definition Classes
    Task
  36. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  37. val task: FullTask[R, _]
    Definition Classes
    Task
  38. def toString(): String
    Definition Classes
    Task → AnyRef → Any
  39. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  42. final def withOrchestratorAndTaskPrefix(message: ⇒ String): String
    Definition Classes
    Task
  43. def [B](y: B): (TaskQuorum[R], B)
    Implicit
    This member is added by an implicit conversion from TaskQuorum[R] to ArrowAssoc[TaskQuorum[R]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from TaskSpawnOrchestrator[R, Quorum[R]]

Inherited from Task[R]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from TaskQuorum[R] to any2stringadd[TaskQuorum[R]]

Inherited by implicit conversion StringFormat from TaskQuorum[R] to StringFormat[TaskQuorum[R]]

Inherited by implicit conversion Ensuring from TaskQuorum[R] to Ensuring[TaskQuorum[R]]

Inherited by implicit conversion ArrowAssoc from TaskQuorum[R] to ArrowAssoc[TaskQuorum[R]]

Ungrouped