gall: in +ap-doff, process oldest subs first

Start by killing subscription nonce 0, then work our way up instead of
down. We enhance the printf with a "total nonces" indicator so we can
still easily see the progress being made.
This commit is contained in:
fang 2022-08-10 22:47:08 +02:00
parent 8033fe760e
commit 39cd895a55
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972

View File

@ -1778,15 +1778,21 @@
=+ [wyr dok]=i.subs
?: =(ship `ship.dok)
$(subs t.subs)
=/ let (~(got by boar.yoke) wyr dok)
|- ^+ ap-core
~> %slog.[0 leaf+"gall: +ap-doff {<[agent-name wyr dok let]>}"]
=. ap-core (ap-pass [(scot %ud let) wyr] %agent dok %leave ~)
?. =(0 let)
$(let (dec let))
:: kill old-style subscription wire with no nonce
::
=. ap-core (ap-pass wyr %agent dok %leave ~)
:: kill new-style subscriptions at every previously-known nonce
::
=/ let (~(got by boar.yoke) wyr dok)
=/ non 0
|- ^+ ap-core
%- =- (slog leaf+- ~)
"gall: +ap-doff {<[agent-name wyr dok]>} {<non>}/{<,.let>}"
=. ap-core (ap-pass [(scot %ud non) wyr] %agent dok %leave ~)
?: (lth non let)
$(non +(non))
:: do the %kick last: leaves must be processed first
::
=. ap-core (ap-pass wyr %huck dok %b %huck [%gall %unto %kick ~])
^$(subs t.subs)
:: +ap-mule: run virtualized with intercepted scry, preserving type