ames: use fi-emit for %fine gifts

This commit is contained in:
yosoyubik 2023-04-18 05:31:23 +02:00
parent 790a0de292
commit 5c838a42a7

View File

@ -3880,6 +3880,7 @@
^+ same ^+ same
(trace %fine verb her ships.bug.ames-state print) (trace %fine verb her ships.bug.ames-state print)
:: ::
++ fi-emit |=(move fine(event-core (emit +<)))
++ fi-deq (deq want) ++ fi-deq (deq want)
++ fi-gauge (ga metrics.keen (wyt:fi-deq wan.keen)) ++ fi-gauge (ga metrics.keen (wyt:fi-deq wan.keen))
++ fi-wait |=(tim=@da (fi-pass-timer %b %wait tim)) ++ fi-wait |=(tim=@da (fi-pass-timer %b %wait tim))
@ -3889,15 +3890,15 @@
|=(=hoot fine(event-core (send-blob for=| her `@ux`hoot))) |=(=hoot fine(event-core (send-blob for=| her `@ux`hoot)))
:: ::
++ fi-clean-up ++ fi-clean-up
|= [=^duct core=_event-core] |= [=^duct =_fine]
:: at the moment only %spider keeps state about remote scries :: at the moment only %spider keeps state about remote scries
:: ::
?+ duct core ?+ duct fine
[[%gall %use %spider @ ship=@ %thread tid=@ *] *] [[%gall %use %spider @ ship=@ %thread tid=@ *] *]
=/ =cage spider-stop+!>([&7.-.duct |]) =/ =cage spider-stop+!>([&7.-.duct |])
=/ poke=* [%0 %m [p q.q]:cage] =/ poke=* [%0 %m [p q.q]:cage]
=/ =plea [%g /ge/spider poke] =/ =plea [%g /ge/spider poke]
(emit:core duct %pass /fine/unsub %g %plea our plea) (fi-emit:fine duct %pass /fine/unsub %g %plea our plea)
== ==
:: ::
+| %entry-points +| %entry-points
@ -3964,7 +3965,7 @@
?. |(all (~(has in listeners.keen) duct)) ?. |(all (~(has in listeners.keen) duct))
%. fine %. fine
(fi-trace fin.veb |.("{<duct>} not a listener for {<path>}")) (fi-trace fin.veb |.("{<duct>} not a listener for {<path>}"))
=? event-core all =? fine all
:: notify listeners by inspecting their :: notify listeners by inspecting their
:: ducts and sending appropiate clean up moves :: ducts and sending appropiate clean up moves
:: ::
@ -3974,20 +3975,20 @@
:: ::
++ fi-error ++ fi-error
|= =goof |= =goof
^+ fine
:: we want to propagate the crash to the listeners and then :: we want to propagate the crash to the listeners and then
:: cancel this request, so it doesn't continue forever resending :: cancel this request, so it doesn't continue forever resending
:: request packets :: request packets
:: ::
%- (fi-trace fin.veb |.("error {<mote.goof>} {<fi-full-path>}")) %- (fi-trace fin.veb |.("error {<mote.goof>} {<fi-full-path>}"))
=. event-core =. listeners.keen (~(del in listeners.keen) duct)
%- ~(rep in listeners.keen) %- ~(rep in listeners.keen)
|= [=^duct core=_event-core] |= [=^duct =_fine]
=. core (fi-clean-up duct core) =. fine (fi-clean-up duct fine)
:: TODO return a %tune with data=~ (unit (unit cask)), instead? :: TODO return a %tune with data=~ (unit (unit cask)), instead?
:: have a gift for error handling? check with ~master-morzod :: have a gift for error handling? check with ~master-morzod
:: ::
(emit:core duct %give %miss fi-full-path) (fi-emit:fine duct %give %miss fi-full-path)
fine(listeners.keen (~(del in listeners.keen) duct))
:: ::
+| %implementation +| %implementation
:: ::
@ -4028,7 +4029,7 @@
%- (fi-trace fin.veb |.("done {(spud fi-full-path)}")) %- (fi-trace fin.veb |.("done {(spud fi-full-path)}"))
%- ~(rep in listeners.keen) %- ~(rep in listeners.keen)
|= [=^duct =_fine] |= [=^duct =_fine]
fine(event-core (emit:fine duct %give gift)) (fi-emit:fine duct %give gift)
:: ::
++ fi-first-rcv ++ fi-first-rcv
|= =meow |= =meow
@ -4085,7 +4086,7 @@
++ fi-pass-timer ++ fi-pass-timer
|= =note |= =note
=/ =wire (welp /fine/behn/wake/(scot %p her) path) =/ =wire (welp /fine/behn/wake/(scot %p her) path)
fine(event-core (emit unix-duct.ames-state %pass wire note)) (fi-emit unix-duct.ames-state %pass wire note)
:: ::
++ fi-set-wake ++ fi-set-wake
^+ fine ^+ fine