gall: cork a subscription's ames flow on-kick

Gall tells ames to %cork flows for subscriptions it has closed.
Receiving a kick also closes a subscription, but gall wasn't issuing a
%cork in that case. We correct that here.

Inlines +mo-handle-ames-response's logic at its only callsite.
This commit is contained in:
fang 2022-08-08 22:21:34 +02:00
parent 8eb8a1da29
commit e396ddcdaa
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972

View File

@ -827,7 +827,15 @@
:: ::
!! !!
=/ =ames-response ;;(ames-response payload.sign-arvo) =/ =ames-response ;;(ames-response payload.sign-arvo)
(mo-handle-ames-response ames-response) :: %d: diff; ask clay to validate .noun as .mark
:: %x: kick; tell agent the publisher canceled the subscription, and
:: cork; tell ames to close the associated flow.
::
?- -.ames-response
%d (mo-give %unto %raw-fact mark.ames-response noun.ames-response)
%x =. mo-core (mo-give %unto %kick ~)
(mo-pass wire %a %cork ship)
==
:: ::
[%ames %lost *] [%ames %lost *]
:: note this should only happen on reverse bones, so only facts :: note this should only happen on reverse bones, so only facts
@ -1072,18 +1080,6 @@
%u [%leave ~] %u [%leave ~]
== ==
(mo-pass wire %g %deal [ship our] agent-name deal) (mo-pass wire %g %deal [ship our] agent-name deal)
:: +mo-handle-ames-response: handle ames response message.
::
++ mo-handle-ames-response
|= =ames-response
^+ mo-core
:: %d: diff; ask clay to validate .noun as .mark
:: %x: kick; tell agent the publisher canceled the subscription
::
?- -.ames-response
%d (mo-give %unto %raw-fact mark.ames-response noun.ames-response)
%x (mo-give %unto %kick ~)
==
:: +mo-spew: handle request to set verbosity toggles on debug output :: +mo-spew: handle request to set verbosity toggles on debug output
:: ::
++ mo-spew ++ mo-spew