summaryrefslogtreecommitdiff
path: root/arvo/iris.hoon
diff options
context:
space:
mode:
Diffstat (limited to 'arvo/iris.hoon')
-rw-r--r--arvo/iris.hoon30
1 files changed, 27 insertions, 3 deletions
diff --git a/arvo/iris.hoon b/arvo/iris.hoon
index ea2a59f..2639843 100644
--- a/arvo/iris.hoon
+++ b/arvo/iris.hoon
@@ -287,6 +287,28 @@
connection-by-id (~(del by connection-by-id.state) id)
connection-by-duct (~(del by connection-by-duct.state) duct.u.con)
==
+ ++ ws-connect
+ |= [desk=term url=@t]
+ ~& iris-ws-connect=[desk url]
+ :: TODO ... the wid comes from vere tho...?
+ =^ id next-id.state [next-id.state +(next-id.state)]
+ :: add a new open session
+ =/ wid id
+ ::
+ =. connection-by-id.state
+ %+ ~(put by connection-by-id.state) id
+ [duct [0 3 ~ ~ 0 ~]]
+ :: keep track of the duct for cancellation
+ ::
+ =. connection-by-duct.state
+ (~(put by connection-by-duct.state) duct id)
+ :- [outbound-duct.state %give %websocket-handshake wid url]~
+ state
+ ++ ws-event
+ |= [id=@ud event=websocket-event:eyre]
+ ~& iris-ws-event=[id event]
+ :- [outbound-duct.state %give %websocket-response id event]~
+ state
--
--
:: end the =~
@@ -360,12 +382,14 @@
%receive
=^ moves state.ax (receive:client +.task)
[moves light-gate]
- :: UIP-125
::
+ :: UIP-125
%websocket-connect
- `light-gate
+ =^ moves state.ax (ws-connect:client +.task)
+ [moves light-gate]
%websocket-event
- `light-gate
+ =^ moves state.ax (ws-event:client +.task)
+ [moves light-gate]
==
:: http-client issues no requests to other vanes
::