mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 06:35:32 +03:00
arvo: passes errors to all vanes
This commit is contained in:
parent
5f0f32d96a
commit
df970ed417
@ -543,10 +543,11 @@
|
||||
=^ gat sac
|
||||
(~(slap wa sac) rig [%limb %call])
|
||||
::
|
||||
:: sample is [duct (hypo (hobo task))]
|
||||
:: sample is [duct (unit goof) (hypo (hobo task))]
|
||||
::
|
||||
=/ sam=mill
|
||||
(slid duc (slix task))
|
||||
=* err !>(dud)
|
||||
(slid duc (slid err (slix task)))
|
||||
=^ pro sac (slur sac gat sam)
|
||||
(peel pro)
|
||||
:: +take:spin:plow:va: retreat statefully
|
||||
@ -560,12 +561,13 @@
|
||||
=/ src=vase
|
||||
[[%atom %tas `from] from]
|
||||
::
|
||||
:: sample is [wire duct (hypo sign=[term gift])]
|
||||
:: sample is [wire duct (unit goof) (hypo sign=[term gift])]
|
||||
::
|
||||
=/ sam=mill
|
||||
:: =/ tea !>(wire)
|
||||
=* tea [pah.vil wire]
|
||||
(slid tea (slid duc (slix (slid src gift))))
|
||||
=* err !>(dud)
|
||||
(slid tea (slid duc (slid err (slix (slid src gift)))))
|
||||
=^ pro sac (slur sac gat sam)
|
||||
(peel pro)
|
||||
--
|
||||
|
@ -916,7 +916,8 @@
|
||||
:: +call: handle request $task
|
||||
::
|
||||
++ call
|
||||
|= [=duct type=* wrapped-task=(hobo task)]
|
||||
|= [=duct dud=(unit goof) type=* wrapped-task=(hobo task)]
|
||||
?< ?=(^ dud)
|
||||
::
|
||||
=/ =task ((harden task) wrapped-task)
|
||||
:: %born: set .unix-duct and start draining .queued-events
|
||||
@ -924,7 +925,7 @@
|
||||
?: ?=(%born -.task)
|
||||
:: process %born using wrapped adult ames
|
||||
::
|
||||
=^ moves adult-gate (call:adult-core duct type task)
|
||||
=^ moves adult-gate (call:adult-core duct dud type task)
|
||||
:: if no events were queued up, metamorphose
|
||||
::
|
||||
?~ queued-events
|
||||
@ -936,14 +937,19 @@
|
||||
[moves larval-gate]
|
||||
:: any other event: enqueue it until we have a .unix-duct
|
||||
::
|
||||
:: XX what to do with errors?
|
||||
::
|
||||
=. queued-events (~(put to queued-events) %call duct type task)
|
||||
[~ larval-gate]
|
||||
:: +take: handle response $sign
|
||||
::
|
||||
++ take
|
||||
|= [=wire =duct type=* =sign]
|
||||
|= [=wire =duct dud=(unit goof) type=* =sign]
|
||||
?< ?=(^ dud)
|
||||
:: enqueue event if not a larval drainage timer
|
||||
::
|
||||
:: XX what to do with errors?
|
||||
::
|
||||
?. =(/larva wire)
|
||||
=. queued-events (~(put to queued-events) %take wire duct type sign)
|
||||
[~ larval-gate]
|
||||
@ -982,8 +988,8 @@
|
||||
=^ first-event queued-events ~(get to queued-events)
|
||||
=^ moves adult-gate
|
||||
?- -.first-event
|
||||
%call (call:adult-core +.first-event)
|
||||
%take (take:adult-core +.first-event)
|
||||
%call (call:adult-core [duct ~ type wrapped-task]:+.first-event)
|
||||
%take (take:adult-core [wire duct ~ type sign]:+.first-event)
|
||||
==
|
||||
:: .queued-events has been cleared; metamorphose
|
||||
::
|
||||
@ -1049,8 +1055,9 @@
|
||||
:: +call: handle request $task
|
||||
::
|
||||
++ call
|
||||
|= [=duct type=* wrapped-task=(hobo task)]
|
||||
|= [=duct dud=(unit goof) type=* wrapped-task=(hobo task)]
|
||||
^- [(list move) _ames-gate]
|
||||
?< ?=(^ dud)
|
||||
::
|
||||
=/ =task ((harden task) wrapped-task)
|
||||
::
|
||||
@ -1077,8 +1084,9 @@
|
||||
:: +take: handle response $sign
|
||||
::
|
||||
++ take
|
||||
|= [=wire =duct type=* =sign]
|
||||
|= [=wire =duct dud=(unit goof) type=* =sign]
|
||||
^- [(list move) _ames-gate]
|
||||
?< ?=(^ dud)
|
||||
::
|
||||
=/ event-core (per-event [our now eny scry-gate] duct ames-state)
|
||||
::
|
||||
|
@ -246,10 +246,12 @@
|
||||
::
|
||||
++ call
|
||||
|= $: hen=duct
|
||||
dud=(unit goof)
|
||||
type=*
|
||||
wrapped-task=(hobo task:able)
|
||||
==
|
||||
^- [(list move) _behn-gate]
|
||||
?< ?=(^ dud)
|
||||
::
|
||||
=/ =task:able ((harden task:able) wrapped-task)
|
||||
::
|
||||
@ -291,8 +293,9 @@
|
||||
::
|
||||
++ stay state
|
||||
++ take
|
||||
|= [tea=wire hen=duct hin=(hypo sign)]
|
||||
|= [tea=wire hen=duct dud=(unit goof) hin=(hypo sign)]
|
||||
^- [(list move) _behn-gate]
|
||||
?< ?=(^ dud)
|
||||
?> ?=([%drip @ ~] tea)
|
||||
=/ event-core (per-event [our now hen] state)
|
||||
=^ moves state
|
||||
|
@ -4063,10 +4063,12 @@
|
||||
|% ::
|
||||
++ call :: handle request
|
||||
|= $: hen=duct
|
||||
dud=(unit goof)
|
||||
type=*
|
||||
wrapped-task=(hobo task:able)
|
||||
==
|
||||
^- [(list move) _..^$]
|
||||
?< ?=(^ dud)
|
||||
::
|
||||
=/ req=task:able ((harden task:able) wrapped-task)
|
||||
:: only one of these should be going at once, so queue
|
||||
@ -4398,8 +4400,9 @@
|
||||
::
|
||||
++ stay [ver ruf]
|
||||
++ take :: accept response
|
||||
|= [tea=wire hen=duct hin=(hypo sign)]
|
||||
|= [tea=wire hen=duct dud=(unit goof) hin=(hypo sign)]
|
||||
^+ [*(list move) ..^$]
|
||||
?< ?=(^ dud)
|
||||
?: ?=([%commit @ *] tea)
|
||||
=* syd i.t.tea
|
||||
=^ mos ruf
|
||||
|
@ -512,10 +512,12 @@
|
||||
|% :: poke+peek pattern
|
||||
++ call :: handle request
|
||||
|= $: hen=duct
|
||||
dud=(unit goof)
|
||||
type=*
|
||||
wrapped-task=(hobo task:able)
|
||||
==
|
||||
^+ [*(list move) ..^$]
|
||||
?< ?=(^ dud)
|
||||
=/ task=task:able ((harden task:able) wrapped-task)
|
||||
:: the boot event passes thru %dill for initial duct distribution
|
||||
::
|
||||
@ -620,8 +622,9 @@
|
||||
++ stay all
|
||||
::
|
||||
++ take :: process move
|
||||
|= {tea/wire hen/duct hin/(hypo sign)}
|
||||
|= {tea/wire hen/duct dud/(unit goof) hin/(hypo sign)}
|
||||
^+ [*(list move) ..^$]
|
||||
?< ?=(^ dud)
|
||||
=/ nus (ax hen)
|
||||
?~ nus
|
||||
:: :hen is an unrecognized duct
|
||||
|
@ -1982,8 +1982,9 @@
|
||||
~% %http-server ..is ~
|
||||
|%
|
||||
++ call
|
||||
|= [=duct type=* wrapped-task=(hobo task:able)]
|
||||
|= [=duct dud=(unit goof) type=* wrapped-task=(hobo task:able)]
|
||||
^- [(list move) _http-server-gate]
|
||||
?< ?=(^ dud)
|
||||
::
|
||||
=/ task=task:able ((harden task:able) wrapped-task)
|
||||
:: %crud: notifies us of an event failure
|
||||
@ -2166,8 +2167,9 @@
|
||||
==
|
||||
::
|
||||
++ take
|
||||
|= [=wire =duct wrapped-sign=(hypo sign)]
|
||||
|= [=wire =duct dud=(unit goof) wrapped-sign=(hypo sign)]
|
||||
^- [(list move) _http-server-gate]
|
||||
?< ?=(^ dud)
|
||||
:: unwrap :sign, ignoring unneeded +type in :p.wrapped-sign
|
||||
::
|
||||
=/ =sign q.wrapped-sign
|
||||
|
@ -6129,8 +6129,9 @@
|
||||
:: the +per-event core, which is Ford's main build engine.
|
||||
::
|
||||
++ call
|
||||
|= [=duct type=* wrapped-task=(hobo task:able)]
|
||||
|= [=duct dud=(unit goof) type=* wrapped-task=(hobo task:able)]
|
||||
^- [(list move) _ford-gate]
|
||||
?< ?=(^ dud)
|
||||
::
|
||||
=/ task=task:able ((harden task:able) wrapped-task)
|
||||
:: we wrap +per-event with a call that binds our event args
|
||||
@ -6242,8 +6243,9 @@
|
||||
:: the +per-event core, which is Ford's main build engine.
|
||||
::
|
||||
++ take
|
||||
|= [=wire =duct wrapped-sign=(hypo sign)]
|
||||
|= [=wire =duct dud=(unit goof) wrapped-sign=(hypo sign)]
|
||||
^- [(list move) _ford-gate]
|
||||
?< ?=(^ dud)
|
||||
:: unwrap :sign, ignoring unneeded +type in :p.wrapped-sign
|
||||
::
|
||||
=/ =sign q.wrapped-sign
|
||||
@ -6346,7 +6348,7 @@
|
||||
^+ ford-gate
|
||||
::
|
||||
=. ax old
|
||||
=. ford-gate +:(call ~[/ford-load-self] *type %trim 0)
|
||||
=. ford-gate +:(call ~[/ford-load-self] ~ *type %trim 0)
|
||||
ford-gate
|
||||
:: +stay: produce current state
|
||||
::
|
||||
|
@ -1478,8 +1478,9 @@
|
||||
::
|
||||
++ call
|
||||
~% %gall-call +> ~
|
||||
|= [=duct hic=(hypo (hobo task:able))]
|
||||
|= [=duct dud=(unit goof) hic=(hypo (hobo task:able))]
|
||||
^- [(list move) _gall-payload]
|
||||
?< ?=(^ dud)
|
||||
::
|
||||
~| [%gall-call-failed duct q.hic]
|
||||
=/ =task:able ((harden task:able) q.hic)
|
||||
@ -1985,8 +1986,9 @@
|
||||
::
|
||||
++ take
|
||||
~/ %gall-take
|
||||
|= [=wire =duct hin=(hypo sign-arvo)]
|
||||
|= [=wire =duct dud=(unit goof) hin=(hypo sign-arvo)]
|
||||
^- [(list move) _gall-payload]
|
||||
?< ?=(^ dud)
|
||||
::
|
||||
~| [%gall-take-failed wire]
|
||||
::
|
||||
|
@ -303,8 +303,9 @@
|
||||
~% %http-client ..is ~
|
||||
|%
|
||||
++ call
|
||||
|= [=duct type=* wrapped-task=(hobo task:able)]
|
||||
|= [=duct dud=(unit goof) type=* wrapped-task=(hobo task:able)]
|
||||
^- [(list move) _light-gate]
|
||||
?< ?=(^ dud)
|
||||
::
|
||||
=/ task=task:able ((harden task:able) wrapped-task)
|
||||
:: %crud: notifies us of an event failure
|
||||
@ -376,8 +377,9 @@
|
||||
:: http-client issues no requests to other vanes
|
||||
::
|
||||
++ take
|
||||
|= [=wire =duct wrapped-sign=*]
|
||||
|= [=wire =duct dud=(unit goof) wrapped-sign=*]
|
||||
^- [(list move) _light-gate]
|
||||
?< ?=(^ dud)
|
||||
!!
|
||||
::
|
||||
++ light-gate ..$
|
||||
|
@ -965,9 +965,11 @@
|
||||
:: hic: event data
|
||||
::
|
||||
hen/duct
|
||||
dud=(unit goof)
|
||||
hic/(hypo (hobo task:able))
|
||||
==
|
||||
^- [(list move) _..^$]
|
||||
?< ?=(^ dud)
|
||||
=/ =task:able ((harden task:able) q.hic)
|
||||
=^ did lex
|
||||
abet:(~(call of [our now eny] lex) hen task)
|
||||
@ -1194,9 +1196,11 @@
|
||||
::
|
||||
tea/wire
|
||||
hen/duct
|
||||
dud=(unit goof)
|
||||
hin/(hypo sign)
|
||||
==
|
||||
^- [(list move) _..^$]
|
||||
?< ?=(^ dud)
|
||||
=^ did lex abet:(~(take of [our now eny] lex) tea hen q.hin)
|
||||
[did ..^$]
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user