Stage

rescala.extra.reactor.ReactorBundle.Stage
case class Stage[T](actions: List[ReactorAction[T]])

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

def loop(body: => Stage[T]): Stage[T]

Executes the body in a loop.

Executes the body in a loop.

Attributes

body

The Stage to be executes repeatedly

def modify(modifier: T => T): Stage[T]

Modifies the value of the Reactor.

Modifies the value of the Reactor.

Attributes

modifier

A function that has the old Reactor value as input and returns a new Reactor value.

Returns:

A StageBuilder describing the Reactor behaviour.

def next[E](event: Event[E])(body: E => Stage[T]): Stage[T]

Waits until the event is triggered.

Waits until the event is triggered.

When the event is triggered the given body is executed in the same transaction.

Attributes

E

the event's type.

body

the code to execute when the event is triggered.

event

the event to wait for.

def next(event: Event[Unit])(body: => Stage[T]): Stage[T]

Waits until the event is triggered.

Waits until the event is triggered.

When the event is triggered the given body is executed in the same transaction.

Attributes

body

the code to execute when the event is triggered.

event

the event to wait for.

def read(body: T => Stage[T]): Stage[T]

Reads the current reactor value.

Reads the current reactor value.

Executes the body with the current reactor value and expects another Stage as result.

A usage example could be returning different Stages depending on the event value.

Attributes

body

The function building the resulting Stage

def set(newValue: T): Stage[T]

Sets the value of the Reactor.

Sets the value of the Reactor.

Attributes

newValue

The new value of the Reactor.

Returns:

A StageBuilder describing the Reactor behaviour.

def until[E](event: Event[E], body: => Stage[T], interruptHandler: E => Stage[T]): Stage[T]

Executes it's body until an event is fired.

Executes it's body until an event is fired.

Until executes the body until the given event is fired. When the event is fired, until executes the interruptHandler.

Attributes

E

The type of the event value.

body

The Stage to be executes by default.

event

The event indicating the interrupt.

interruptHandler

A function taking the interrupt event's value and returning a Stage. It is executed when the interrupt is fired.

def until(event: Event[Unit], body: => Stage[T], interruptHandler: Stage[T]): Stage[T]

Executes it's body until an event is fired.

Executes it's body until an event is fired.

Until executes the body until the given event is fired. When the event is fired, until executes the interruptHandler.

Attributes

body

The Stage to be executes by default.

event

The event indicating the interrupt.

interruptHandler

A function taking the interrupt event's value and returning a Stage. It is executed when the interrupt is fired.

def until(event: Event[Any], body: => Stage[T]): Stage[T]

Executes it's body until an event is fired.

Executes it's body until an event is fired.

Until executes the body until the given event is fired.

Attributes

E

The type of the event value.

body

The Stage to be executes by default.

event

The event indicating the interrupt.

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product