From: Christopher Date: Fri, 21 Feb 2020 05:49:36 +0000 (-0600) Subject: link to session.json X-Git-Url: http://git.entropealabs.com/?a=commitdiff_plain;h=0133aaf0725e0e14248e9e8d343138ec4eedb454;p=wampex.git link to session.json --- diff --git a/README.md b/README.md index 7ea633e..be53c9a 100644 --- a/README.md +++ b/README.md @@ -150,107 +150,9 @@ WAMPex currently maps each session to a seperate transport connection. This mean Internally WAMPex uses [Registry](https://hexdocs.pm/elixir/Registry.html#module-using-as-a-pubsub) for local PubSub. Subscriptions and Callees are registered with separate Registry instances, partitioned over the available system CPU cores. -The Session management is handled by a state machine, written using [StatesLanguage](https://github.com/citybaseinc/states_language). The JSON looks like this. - -```json -{ - "Comment": "Session State Machine", - "StartAt": "WaitForTransport", - "States": { - "WaitForTransport": { - "Type": "Task", - "Resource": "InitTransport", - "TransitionEvent": "{:connected, true}", - "Next": "Init", - "Catch": [ - { - "ErrorEquals": ["{:connected, false}"], - "Next": "Abort" - } - ] - }, - "Init": { - "Type": "Task", - "Resource": "Hello", - "TransitionEvent": ":hello_sent", - "Next": "Established", - "Catch": [ - { - "ErrorEquals": [":abort"], - "Next": "Abort" - } - - ] - }, - "Established": { - "Type": "Choice", - "Resource": "Established", - "Choices": [ - { - "StringEquals": ":message_received", - "Next": "HandleMessage" - }, - { - "StringEquals": ":goodbye", - "Next": "GoodBye" - }, - { - "StringEquals": ":abort", - "Next": "Abort" - } - ] - }, - "HandleMessage": { - "Type": "Choice", - "Resource": "HandleMessage", - "Choices": [ - { - "StringEquals": ":noop", - "Next": "Established" - }, - { - "StringEquals": ":event", - "Next": "Event" - }, - { - "StringEquals": ":invocation", - "Next": "Invocation" - }, - { - "StringEquals": ":abort", - "Next": "Abort" - }, - { - "StringEquals": ":goodbye", - "Next": "GoodBye" - } - ] - }, - "Event": { - "Type": "Task", - "Resource": "HandleEvent", - "Next": "Established" - }, - "Invocation": { - "Type": "Task", - "Resource": "HandleInvocation", - "Next": "Established" - }, - "GoodBye": { - "Type": "Task", - "Resource": "GoodBye", - "End": true - }, - "Abort": { - "Type": "Task", - "Resource": "Abort", - "End": true - } - } -} -``` +The Session management is handled by a state machine, written using [StatesLanguage](https://github.com/citybaseinc/states_language). You can view the specification in [priv/session.json](priv/session.json). -You can copy and paste this snippet into the JSON input at https://citybaseinc.github.io/states-language-editor/ to edit and visualize the state machine. +You can copy and paste the JSON into the JSON input at https://citybaseinc.github.io/states-language-editor/ to edit and visualize the state machine. ## Local Development