Jörgen Brandt

PhD student (Humboldt-Universität zu Berlin)

PhD student with focus on programming language design and distributed systems.

Past Activities

Jörgen Brandt
Code BEAM STO 2018
01 Jun 2018
14.30 - 15.15

Beyond state machines: services as petri nets

An important design principle in Erlang is the integration of domain models as OTP behaviours. Services managing session state, resource allocation, or service start order are often modeled as state machines. And several OTP behaviours around state machines have been conceived for Erlang. However, plain state machines often suffer from the explosion of the state space as soon as multiple state variables appear in combination. Also some applications have only an infinite representation, if modeled as a state machine.

We address these challenges by introducing gen_pnet, a new OTP behaviour based on Petri nets. Petri nets are a class of transition systems generalising service state by representing state as tokens produced and consumed by transitions. We consider several examples for Petri nets in gen_pnet such as a worker pool, a scheduler, as well as a distributed programming language. We also discuss how Erlang error handling facilities play with gen_pnet and how unit testing works.


Demonstrate how services can be designed and implemented as Petri nets in Erlang