package event
This package implements the syntax of the CSO alternation notations, and provides hooks for the semantics of that notation.
The body of an alternation
specification consists of a sequence (possibly empty) of executable
event specifications separated by |
and possibly followed
by:
| after(timeout) ==> { ... }
or
| orelse ==> { ... }
or
| after(timeout) ==> { ... } | orelse ==> { ... }
An executable event specification takes one of the following forms:
outport =!=> OutEvent (guard && outport) =!=> OutEvent inport =?=> InEvent (guard && inport) =?=> InEvent inport =??=> InEvent // extended rendezvous form (guard && inport) =??=> InEvent // extended rendezvous form
Concessions to readability: a Chan
expression may appear in place of
a port expression.
Events and their effects
OutEvent form: Effect when triggered {expr} outport!expr {expr} ==> { command: Unit } {outport!expr; command}
InEvent form: Effect when triggered { bv => body: Unit } {val bv=inport?(); body }
For an extended rendezvous InEvent
the correspondence is
{ bv => body: Unit } { inport??({ bv => body}) }
- Alphabetic
- By Inheritance
- event
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
class
AfterDeadline
extends AnyRef
Syntactic continuation of after
(deadline)
notation. -
case class
AfterEvent
(deadline: () ⇒ Long, body: () ⇒ Unit) extends Event with Product with Serializable
An
after
"event" - trait Event extends AnyRef
-
abstract
case class
ExecutableEvent
() extends ExecutableEventSyntax with Product with Serializable
The meaning of an inport or outport events is represented by a (concrete)
ExecutableEvent
.The meaning of an inport or outport events is represented by a (concrete)
ExecutableEvent
. Alternation constructs work by choosing an executable event that is ready for execution, then running it. -
trait
ExecutableEventSyntax
extends Event
ExecutableEvent
s are composed syntactically by infix|
and its prefix form. -
class
InPortEvent
[+T] extends ExecutableEvent
Executable event corresponding to
guard && port =?=> body
-
class
InPortEventExtended
[+T] extends ExecutableEvent
Executable event corresponding to
guard && port =??=> body
-
case class
InfixEventSyntax
(l: Event, r: Event) extends ExecutableEventSyntax with Product with Serializable
Syntactic composition of events
l
andr
.Syntactic composition of events
l
andr
. (These are not really executable, but life's too short to find a way to make the Scala type system do what amounts to a complete syntax check.) -
case class
NormalAlt
(events: Seq[ExecutableEvent], after: AfterEvent, orelse: OrElseEvent) extends Product with Serializable
Represents the "compiled" body of an alternation
-
case class
OrElseEvent
(body: () ⇒ Unit) extends Event with Product with Serializable
An
orelse
"event" -
class
OutPortEvent
[-T] extends ExecutableEvent
Executable event corresponding to
guard && port =!=> body
-
class
OutPortEventThen
[-T] extends ExecutableEvent
Executable event corresponding to
guard && port =!=> body ==> cont
Value Members
-
def
after(deadline: ⇒ basis.Nanoseconds): AfterDeadline
Start of after
(deadline)
notation (unit is nanoseconds). -
def
|(events: Seq[ExecutableEvent]): ExecutableEventSyntax
Prefix notation for
|
:|(e1, ... en)
=e1 | ... | en
-
object
orelse
Start of the orelse notation.