shrub/pkg/arvo/ted/keen.hoon
yosoyubik cfc1a58559 spider: fix tracking remote-scry requests
Prevously we were tracking remote scry requests using a map, assuming
that every thread would do just one remote scry request. This is not
right. A thread that did multiple +keen:strandio was treated as
if just the last call existed, overwritten previous entries in the map.

Now we track remote scries using a jug that accounts for multiple %keen
tasks per thread.

The logic for sending %yawns to %ames has been updated for the following
scenarios:

- +thread-fail will always send a %yawn task
- +thread-done doesn't send %yawn tasks
  - unless a running thread is stopped
- if %spider is reloaded:
  - %yawn tasks will be sent for any running or starting thread

/lib/strandio also removes +take-tune from +keen,  decoupling
sending %tasks and receiving %signs. This allows for clients
to request multiple paths at future cases, without blocking.
2023-04-27 13:55:06 +02:00

26 lines
611 B
Plaintext

/- spider
/+ strandio
=, strand=strand:spider
^- thread:spider
|= arg=vase
=/ m (strand ,vase)
^- form:m
=+ !<([~ =spar:ames] arg)
;< ~ bind:m
(keen:strandio /keen spar)
;< [* roar=(unit roar:ames)] bind:m
(take-tune:strandio /keen)
?~ roar
(pure:m !>(~))
?~ data=q.dat.u.roar
(pure:m !>(~))
::
;< =bowl:spider bind:m get-bowl:strandio
=+ .^ =dais:clay %cb
/(scot %p our.bowl)/[q.byk.bowl]/(scot %da now.bowl)/[p.u.data]
==
=/ res (mule |.((vale.dais q.u.data)))
?. ?=(%| -.res)
(pure:m p.res)
~|(%keen-mark-fail (mean leaf+"-keen: ames vale fail {<mark>}" p.res))