summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--proto.pod39
1 files changed, 29 insertions, 10 deletions
diff --git a/proto.pod b/proto.pod
index 2917b5f..3cd9611 100644
--- a/proto.pod
+++ b/proto.pod
@@ -65,6 +65,8 @@ reply (e.g. C<ser,json>). Accepted serialization formats are defined below.
+
+
=head1 Messages
After the handshake, messages are exchanged asynchronously. There is no
@@ -155,6 +157,7 @@ happens, things should be cleaned up automatically.
+
=head1 Serialization formats
=head2 JSON
@@ -176,42 +179,56 @@ specific to the message type. Messages are delimited with a newline.
=over
+=item PATTERNSYNC
+
+Message type 1. Second element is either C<true> or C<false> to enable or
+disable pattern synchronisation.
+
+ [1,true]
+
=item REGISTER
-Message type 1. The second element is the $pid, encoded as a number. The third
+Message type 2. The second element is the $pid, encoded as a number. The third
element is the $pattern.
- [1,14,["object",null,1]]
+ [2,14,["object",null,1]]
+
+=item REGDONE
+
+Message type 3. No extra elements.
+
+ [3]
=item UNREGISTER
-Message type 2. The second element is the same as the second element of
+Message type 4. The second element is the same as the second element of
REGISTER.
- [2,14]
+ [4,14]
=item TUPLE
-Message type 3. Second element is the $tid, encoded as a number. The third
+Message type 5. Second element is the $tid, encoded as a number. The third
element is the tuple.
- [3,0,["variable","set","listen",false]]
+ [5,0,["variable","set","listen",false]]
=item REPLY
-Message type 4. Exact same encoding as TUPLE.
+Message type 6. Exact same encoding as TUPLE.
- [4,29382,[1]]
+ [6,29382,[1]]
=item CLOSE
-Message type 5. Second element is the $tid, encoded as a number.
+Message type 7. Second element is the $tid, encoded as a number.
- [5,29382]
+ [7,29382]
=back
+
=head2 Gob
=head3 Tuples & Patterns
@@ -223,6 +240,8 @@ Allowed elements and their behaviour are as defined in the Go implementation.
=head3 Messages
+I<TODO:> This section is outdated.
+
Each message is communicated as a different struct. The type of a I<message> is
therefore C<interface{}>. The following structs are used, corresponding to each
of the messages.