Skip to content

Instantly share code, notes, and snippets.

@hintjens
Created September 10, 2015 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hintjens/545d884f9be9346b5237 to your computer and use it in GitHub Desktop.
Save hintjens/545d884f9be9346b5237 to your computer and use it in GitHub Desktop.
<class
name = "sadl_msg"
title = "The SADL Message Protocol"
script = "zproto_codec_c"
package_dir = "."
>
This implements the wireframe SADL protocol
<message name = "PUBLISH">
Client sends data to a topic
<field name = "sender" type = "string" />
<field name = "topic" type = "string" />
<field name = "data" type = "string" />
</message>
<message name = "OK">
Server confirms command was successful
</message>
<message name = "ERROR">
Server reports command failure
<field name = "reason" type = "string" />
</message>
<message name = "SUBSCRIBE">
Client subscribes to a topic
<field name = "sender" type = "string" />
<field name = "topic" type = "string" />
</message>
<message name = "CANCEL">
Client cancels a topic
<field name = "sender" type = "string" />
<field name = "topic" type = "string" />
</message>
<message name = "FETCH">
Client asks for a message, if any
<field name = "sender" type = "string" />
</message>
<message name = "DELIVER">
Server delivers a message to the client
<field name = "topic" type = "string" />
<field name = "data" type = "string" />
</message>
<message name = "EMPTY">
Server reports there was nothing to deliver
</message>
<message name = "SENDTO">
Client sends a message to another client
<field name = "sender" type = "string" />
<field name = "recipient" type = "string" />
<field name = "data" type = "string" />
</message>
</class>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment