You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We support this only for swindon-lattice protocol, not for generic websockets
We process same url as websocket with POST /path?swindon_action=xxx&swindon_token=yyy
Mapping
Connect with POST /path?swindon_action=connect, it returns hello message and token you pass to swindon_token in subsequent connections. Http errors from backend are passed as is.
Method calls are executed in one method per request fasion POST /path?swindon_action=call&swindon_token=yyy. The actual method name and parameters are in the same format as usually sent to backend. Surely, swindon.* methods are disallowed (return 401). Return value is sent in HTTP response.
Input messages (pub-sub, lattices), can be fetched with POST /path?swindon_action=read&swindon_token=yyy&last_received=0&timeout=10&delay=100. With client-defined timeout in seconds. And client-defined buffering delay in milliseconds to give swindon chance to buffer more than one message. Messages are gathered in list of jsons.
If session (token) is expired we return 401
Pros:
Simple easy to understand mapping
Cons:
Needs at least two HTTP connections (which are scarce in browsers)
call requests can occupy connections, leaving read in queue (which might be good too)
As requested in swindon-rs/swindon-js#6.
Basics
swindon-lattice
protocol, not for generic websocketsPOST /path?swindon_action=xxx&swindon_token=yyy
Mapping
POST /path?swindon_action=connect
, it returnshello
message and token you pass toswindon_token
in subsequent connections. Http errors from backend are passed as is.POST /path?swindon_action=call&swindon_token=yyy
. The actual method name and parameters are in the same format as usually sent to backend. Surely,swindon.*
methods are disallowed (return 401). Return value is sent in HTTP response.POST /path?swindon_action=read&swindon_token=yyy&last_received=0&timeout=10&delay=100
. With client-defined timeout in seconds. And client-defined buffering delay in milliseconds to give swindon chance to buffer more than one message. Messages are gathered in list of jsons.Pros:
Cons:
call
requests can occupy connections, leavingread
in queue (which might be good too)/cc @popravich, @rrader?
The text was updated successfully, but these errors were encountered: