mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-09-20 15:08:34 +03:00
Rver cancels subscriptions on correct gall ducts and cancels behn timers correctly as well
This commit is contained in:
parent
cc3013f4e1
commit
fb54af4a31
@ -245,7 +245,7 @@
|
||||
:: We maintain a list of subscriptions so if a channel times out, we
|
||||
:: can cancel all the subscriptions we've made.
|
||||
::
|
||||
subscriptions=(map wire [ship=@p app=term =path])
|
||||
subscriptions=(map wire [ship=@p app=term =path duc=duct])
|
||||
==
|
||||
:: channel-request: an action requested on a channel
|
||||
::
|
||||
@ -1296,7 +1296,7 @@
|
||||
%+ ~(jab by session.channel-state.state) channel-id
|
||||
|= =channel
|
||||
=, i.requests
|
||||
channel(subscriptions (~(put by subscriptions.channel) channel-wire [ship app path]))
|
||||
channel(subscriptions (~(put by subscriptions.channel) channel-wire [ship app path duct]))
|
||||
::
|
||||
$(requests t.requests)
|
||||
::
|
||||
@ -1317,7 +1317,7 @@
|
||||
=. gall-moves
|
||||
:_ gall-moves
|
||||
^- move
|
||||
:^ duct %pass channel-wire
|
||||
:^ duc.u.maybe-subscription %pass channel-wire
|
||||
=, u.maybe-subscription
|
||||
[%g %deal [our ship] `cush:gall`[app %pull ~]]
|
||||
::
|
||||
@ -1329,22 +1329,41 @@
|
||||
$(requests t.requests)
|
||||
::
|
||||
%delete
|
||||
=/ session
|
||||
(~(got by session.channel-state.state) channel-id)
|
||||
=/ unitsession
|
||||
(~(get by session.channel-state.state) channel-id)
|
||||
::
|
||||
?~ unitsession
|
||||
$(requests t.requests)
|
||||
::
|
||||
=/ session u.unitsession
|
||||
=. session.channel-state.state
|
||||
(~(del by session.channel-state.state) channel-id)
|
||||
::
|
||||
=. gall-moves
|
||||
%+ weld
|
||||
gall-moves
|
||||
%+ weld gall-moves
|
||||
::
|
||||
:: produce a list of moves which cancels every gall subscription
|
||||
::
|
||||
%+ turn ~(tap by subscriptions.session)
|
||||
|= [channel-wire=path ship=@p app=term =path duc=^duct]
|
||||
^- move
|
||||
::
|
||||
[duc %pass channel-wire [%g %deal [our ship] app %pull ~]]
|
||||
::
|
||||
?: ?=([%& *] state.session)
|
||||
=. gall-moves
|
||||
:_ gall-moves
|
||||
::
|
||||
^- move
|
||||
?> ?=([%& *] state.session)
|
||||
:^ duct.p.state.session %pass /channel/timeout/[channel-id]
|
||||
[%b %rest date.p.state.session]
|
||||
::
|
||||
:: produce a list of moves which cancels every gall subscription
|
||||
$(requests t.requests)
|
||||
::
|
||||
%+ turn ~(tap by subscriptions.session)
|
||||
|= [channel-wire=path ship=@p app=term =path]
|
||||
^- move
|
||||
::
|
||||
[duct %pass channel-wire [%g %deal [our ship] app %pull ~]]
|
||||
?> ?=([%| *] state.session)
|
||||
=. duct-to-key.channel-state.state
|
||||
(~(del by duct-to-key.channel-state.state) p.state.session)
|
||||
::
|
||||
$(requests t.requests)
|
||||
::
|
||||
@ -1480,10 +1499,10 @@
|
||||
:: produce a list of moves which cancels every gall subscription
|
||||
::
|
||||
%+ turn ~(tap by subscriptions.session)
|
||||
|= [channel-wire=path ship=@p app=term =path]
|
||||
|= [channel-wire=path ship=@p app=term =path duc=^duct]
|
||||
^- move
|
||||
::
|
||||
[duct %pass channel-wire [%g %deal [our ship] app %pull ~]]
|
||||
[duc %pass channel-wire [%g %deal [our ship] app %pull ~]]
|
||||
--
|
||||
:: +handle-ford-response: translates a ford response for the outside world
|
||||
::
|
||||
|
Loading…
Reference in New Issue
Block a user