ames: simplify reset timer

This commit is contained in:
yosoyubik 2023-04-11 14:24:05 +02:00
parent 48a60d602c
commit 4840b2aed2

View File

@ -2629,29 +2629,23 @@
:: ::
++ handle-cork ++ handle-cork
|= =bone |= =bone
^+ peer-core |^ ^+ peer-core
?. (~(has in closing.peer-state) bone) peer-core ?. (~(has in closing.peer-state) bone) peer-core
=/ =message-pump-state =/ pump=message-pump-state
(~(gut by snd.peer-state) bone *message-pump-state) (~(gut by snd.peer-state) bone *message-pump-state)
=? peer-core ?=(^ next-wake.packet-pump-state.message-pump-state) =? event-core ?=(^ next-wake.packet-pump-state.pump)
=* next-wake u.next-wake.packet-pump-state.message-pump-state :: reset-timer for boons
=/ =wire (make-pump-timer-wire her bone)
:: reset timer for boons
:: ::
(pe-emit [/ames]~ %pass wire %b %rest next-wake) (reset-timer her bone u.next-wake.packet-pump-state.pump)
=/ nax-bone=^bone (mix 0b10 bone) =/ nax-bone=^bone (mix 0b10 bone)
=? peer-core (~(has by snd.peer-state) nax-bone) =/ nax-pump=message-pump-state
%- %+ pe-trace odd.veb (~(gut by snd.peer-state) nax-bone *message-pump-state)
=? event-core ?=(^ next-wake.packet-pump-state.nax-pump)
%- %^ ev-trace odd.veb her
|.("remove naxplanation flow {<[her bone=nax-bone]>}") |.("remove naxplanation flow {<[her bone=nax-bone]>}")
=/ nack-pump=^message-pump-state
(~(gut by snd.peer-state) nax-bone *^message-pump-state)
?: ?=(~ next-wake.packet-pump-state.nack-pump)
peer-core
=* next-wake u.next-wake.packet-pump-state.nack-pump
=/ =wire (make-pump-timer-wire her nax-bone)
:: reset timer for naxplanations :: reset timer for naxplanations
:: ::
(pe-emit [/ames]~ %pass wire %b %rest next-wake) (reset-timer her nax-bone u.next-wake.packet-pump-state.nax-pump)
=. peer-state =. peer-state
=, peer-state =, peer-state
%_ peer-state %_ peer-state
@ -2664,6 +2658,11 @@
== ==
peer-core peer-core
:: ::
++ reset-timer
|= [=ship =^bone wake=@da]
(emit [/ames]~ %pass (make-pump-timer-wire ship bone) %b %rest wake)
--
::
+| %internals +| %internals
:: +mu: constructor for |pump message sender core :: +mu: constructor for |pump message sender core
:: ::