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