UP | HOME

RFC002: Event Protocols
Status: Withdrawn

Table of Contents

Introduction

Currently the language includes event definitions which in turn identify the entity that emits them. However, there is no construct today that defines how events are consumed by an entity.

Document Status History

Date Status Comment Grammar Version
[2023-12-07 Thu] Draft   0.2.6
[2023-12-21 Thu] Withdrawn Superceded by RFC004 N/A

Motivation

Alternatives Considered

Event List

module example is

  import [ inventory vehicle ]

  entity Booking is
    identity id -> string

    vehicle -> {0..1} vehicle:Vehicle

    consumes [
      inventory:VehicleAssigned
      inventory:VehicleAvailable
    ]
  end

end

Proposed Change

Examples here are still in-progress.

module example is

  import [ inventory vehicle ]

  entity Booking is
    identity id -> string

    vehicle -> {0..1} vehicle:Vehicle

    accepts
      inventory:VehicleAssigned
        if self.vehicle.is_empty
        then not self.vehicle.is_empty

    accepts
      select while ...
         ... or accepts 
      end

  end

end
Accepts ::=
    "accepts" (AcceptMessage | Select)

AcceptMessage ::=
    IdentifierReference
    ( OperatorIf ConstraintSentence )?
    OperatorThen ( ConstraintSentence | Accepts)

Select ::=
    "select" ( "while" ConstraintSentence )?
    AcceptMessage ( OperatorOr AcceptMessage )*
    "end"

Created: 2023-12-21 Thu 11:13