ames: generalize $deep tasks

currently all $deep tasks are focused on a particular ship but future
 ones might not, so we move $ship to each individual task
This commit is contained in:
yosoyubik 2023-05-30 10:17:17 +02:00
parent 7ce74f36c6
commit d3489cc8db
2 changed files with 21 additions and 17 deletions

View File

@ -795,7 +795,7 @@
[%cork =ship] [%cork =ship]
[%kroc dry=?] [%kroc dry=?]
$>(%plea vane-task) $>(%plea vane-task)
[%deep =ship =deep] [%deep =deep]
:: ::
[%keen spar] [%keen spar]
[%yawn spar] [%yawn spar]
@ -906,11 +906,11 @@
:: $deep: deferred %ames call, from self, to keep +abet cores pure :: $deep: deferred %ames call, from self, to keep +abet cores pure
:: ::
+$ deep +$ deep
$% [%nack =nack=bone =message-blob] $% [%nack =ship =nack=bone =message-blob]
[%sink =target=bone naxplanation=[=message-num =error]] [%sink =ship =target=bone naxplanation=[=message-num =error]]
[%drop =nack=bone =message-num] [%drop =ship =nack=bone =message-num]
[%cork =bone] [%cork =ship =bone]
[%kill =bone] [%kill =ship =bone]
== ==
:: +| %atomics :: +| %atomics
:: ::

View File

@ -2157,11 +2157,15 @@
:: +on-deep: deferred %ames calls from itself :: +on-deep: deferred %ames calls from itself
:: ::
++ on-deep ++ on-deep
|= [=ship =deep] |= =deep
^+ event-core ^+ event-core
=/ ship-state (~(get by peers.ames-state) ship) :: currently $deep tasks are all focused on a
:: particular ship but future ones might not
::
?> ?=([@ =ship *] deep)
=/ ship-state (~(get by peers.ames-state) ship.deep)
?> ?=([~ %known *] ship-state) ?> ?=([~ %known *] ship-state)
=+ peer-core=(abed-peer:pe ship +.u.ship-state) =+ peer-core=(abed-peer:pe ship.deep +.u.ship-state)
|^ ?- -.deep |^ ?- -.deep
%nack abet:(send-nack-trace [nack-bone message-blob]:deep) %nack abet:(send-nack-trace [nack-bone message-blob]:deep)
%sink abet:(sink-naxplanation [target-bone naxplanation]:deep) %sink abet:(sink-naxplanation [target-bone naxplanation]:deep)
@ -3430,7 +3434,7 @@
:: nack-trace bone; assume .ok, clear nack from |sink :: nack-trace bone; assume .ok, clear nack from |sink
:: ::
%+ pe-emit duct %+ pe-emit duct
[%pass /clear-nack %a %deep her %drop (mix 0b10 bone) num] [%pass /clear-nack %a %deep %drop her (mix 0b10 bone) num]
:: if the bone belongs to a closing flow and we got a :: if the bone belongs to a closing flow and we got a
:: naxplanation, don't relay ack to the client vane :: naxplanation, don't relay ack to the client vane
:: ::
@ -3451,7 +3455,7 @@
|.("trying to delete a corked bone={<bone>}") |.("trying to delete a corked bone={<bone>}")
peer-core peer-core
=/ =wire (make-bone-wire her her-rift.channel bone) =/ =wire (make-bone-wire her her-rift.channel bone)
(pe-emit duct %pass wire %a %deep her %kill bone) (pe-emit duct %pass wire %a %deep %kill her bone)
:: +pu: construct |packet-pump core :: +pu: construct |packet-pump core
:: ::
++ pu ++ pu
@ -4015,7 +4019,7 @@
:: ::
=. peer-core =. peer-core
%+ pe-emit duct %+ pe-emit duct
[%pass wire %a %deep her %nack nack-bone message-blob] [%pass wire %a %deep %nack her nack-bone message-blob]
:: ::
(done ok=%.n) (done ok=%.n)
:: ::
@ -4032,7 +4036,7 @@
:: account for publishers that still handle ames-to-ames %pleas :: account for publishers that still handle ames-to-ames %pleas
:: ::
?> &(?=([%cork *] payload.plea) ?=(%flow -.path.plea)) ?> &(?=([%cork *] payload.plea) ?=(%flow -.path.plea))
(pe-emit duct %pass wire %a %deep her %cork bone) (pe-emit duct %pass wire %a %deep %cork her bone)
sink sink
:: ::
:: +ha-boon: handle response message, acking unconditionally :: +ha-boon: handle response message, acking unconditionally
@ -4086,7 +4090,7 @@
:: ::
=/ =wire (make-bone-wire her her-rift.channel target) =/ =wire (make-bone-wire her her-rift.channel target)
%+ pe-emit duct %+ pe-emit duct
[%pass wire %a %deep her %sink target ;;(naxplanation message)] [%pass wire %a %deep %sink her target ;;(naxplanation message)]
:: ack nack-trace message (only applied if we don't later crash) :: ack nack-trace message (only applied if we don't later crash)
:: ::
(done ok=%.y) (done ok=%.y)
@ -4462,12 +4466,12 @@
++ max-backoff ++ max-backoff
^- @dr ^- @dr
?:(?=([[%gall %use %ping *] *] duct) ~s25 ~m2) ?:(?=([[%gall %use %ping *] *] duct) ~s25 ~m2)
:: +in-slow-start: %.y iff we're in "slow-start" mode :: +in-slow-start: %.y if we're in "slow-start" mode
:: ::
++ in-slow-start ++ in-slow-start
^- ? ^- ?
(lth cwnd ssthresh) (lth cwnd ssthresh)
:: +in-recovery: %.y iff we're recovering from a skipped packet :: +in-recovery: %.y if we're recovering from a skipped packet
:: ::
:: We finish recovering when .live-packets finally dips back :: We finish recovering when .live-packets finally dips back
:: down to .cwnd. :: down to .cwnd.
@ -4602,7 +4606,7 @@
%plea (on-plea:event-core [ship plea]:task) %plea (on-plea:event-core [ship plea]:task)
%cork (on-cork:event-core ship.task) %cork (on-cork:event-core ship.task)
%kroc (on-kroc:event-core dry.task) %kroc (on-kroc:event-core dry.task)
%deep (on-deep:event-core [ship deep]:task) %deep (on-deep:event-core deep.task)
:: ::
%keen (on-keen:event-core +.task) %keen (on-keen:event-core +.task)
%yawn (on-cancel-scry:event-core | +.task) %yawn (on-cancel-scry:event-core | +.task)