diff options
| author | polwex <polwex@sortug.com> | 2025-10-31 22:59:42 +0700 |
|---|---|---|
| committer | polwex <polwex@sortug.com> | 2025-10-31 22:59:42 +0700 |
| commit | f019da2e338733dd88d3a8efe60f260d74b9a7ad (patch) | |
| tree | ecccfab6926dd89c3ec0597653cca6e30c62dc41 /arvo/iris.hoon | |
| parent | 54fb3abb81621bd2a5fafbdd9b96a8be8464878e (diff) | |
fixes to iris request flow with threads
Diffstat (limited to 'arvo/iris.hoon')
| -rw-r--r-- | arvo/iris.hoon | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/arvo/iris.hoon b/arvo/iris.hoon index 41a4160..7b618b2 100644 --- a/arvo/iris.hoon +++ b/arvo/iris.hoon @@ -322,7 +322,7 @@ :- [outbound-duct.state %give %websocket-handshake id url]~ state :: - :: incoming websockets event + :: incoming websockets event to be sent BY VERE NOT USERSPACE ++ ws-event |= [wid=@ud event=websocket-event:eyre] ~& iris-ws-event=[wid event duct] @@ -336,13 +336,11 @@ =. wc wc(status %accepted) =. sockets.state (~(put by sockets.state) wid wc) :_ state - :: :~ (watch-agent wid app.wc) - :: == - ~ + :~ (watch-agent wid app.wc) + == %message :_ state - :: :~ (poke-agent [wid +.event] app.wc) - :: == - ~ + :~ (poke-agent [wid +.event] app.wc) + == %reject (cleanup-ws wid) %disconnect (cleanup-ws wid) @@ -517,7 +515,7 @@ ++ load |= old=axle :: |= old=* - :: ^+ ..^$ + ^+ ..^$ :: ~! %loading ..^$(ax old) @@ -533,8 +531,27 @@ |= [lyc=gang pov=path car=term bem=beam] ^- (unit (unit cage)) ~& >> iris-scry=[lyc=lyc pov=pov car=car bem=bem syd=q.bem] + :: TODO this is obviously insecure so should be deprecated soon ?. ?=(%x car) [~ ~] - ?: ?=(%ws q.bem) ``noun+!>(sockets.state.ax) + =/ caller +<.pov + ?: ?=(%ws q.bem) + ?+ s.bem ~ + ~ ``noun+!>(sockets.state.ax) + [%id @ ~] + =/ wid (slav %ud i.s.bem) + =/ socket (~(got by sockets.state.ax) wid) + ?. .=(app.socket caller) ~ + ``noun+!>(socket) + [%url @ ~] + =/ sockets ~(tap by sockets.state.ax) + :: pass a (unit websocket-connection) + :- ~ :- ~ :- %noun !> + |- ?~ sockets ~ + =/ socket=websocket-connection:iris q.i.sockets + ?. .=(app.socket caller) $(sockets t.sockets) + ?: .=(url.socket i.t.s.bem) `socket + $(sockets t.sockets) + == =* ren car =* why=shop &/p.bem =* syd q.bem |
