From 65db4729cd19c8c2cb7db56a6aafc2cc778d52dc Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sun, 26 Feb 2017 02:30:31 -0800 Subject: [PATCH] rendezvous_websocket.py: add idempotency docs --- src/wormhole/server/rendezvous_websocket.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/wormhole/server/rendezvous_websocket.py b/src/wormhole/server/rendezvous_websocket.py index 67e46f4..e489f87 100644 --- a/src/wormhole/server/rendezvous_websocket.py +++ b/src/wormhole/server/rendezvous_websocket.py @@ -38,6 +38,17 @@ from ..util import dict_to_bytes, bytes_to_dict # has claimed the nameplate has also released it, the nameplate is # deallocated (but they will probably keep the underlying mailbox open). +# "claim" and "release" may only be called once per connection, however calls +# across connections (assuming a consistent "side") are idempotent. [connect, +# claim, disconnect, connect, claim] is legal, but not useful, as is a +# "release" for a nameplate that nobody is currently claiming. + +# "open" and "close" may only be called once per connection. They are +# basically idempotent, however "open" doubles as a subscribe action. So +# [connect, open, disconnect, connect, open] is legal *and* useful (without +# the second "open", the second connection would not be subscribed to hear +# about new messages). + # Inbound (client to server) commands are marked as "->" below. Unrecognized # inbound keys will be ignored. Outbound (server to client) responses use # "<-". There is no guaranteed correlation between requests and responses. In