From d406344081b1295f1c7a28647f233d06ea021016 Mon Sep 17 00:00:00 2001 From: yosoyubik Date: Sat, 1 Apr 2023 09:20:49 +0200 Subject: [PATCH] lull, ames: add %wham to cancel all scry requests (we might want to add permissioning to restrict who can send %whams) --- pkg/arvo/gen/hood/wham.hoon | 9 +++++++++ pkg/arvo/gen/hood/yawn.hoon | 4 ++-- pkg/arvo/sys/lull.hoon | 4 +++- pkg/arvo/sys/vane/ames.hoon | 9 +++++---- pkg/arvo/sys/vane/clay.hoon | 4 ++-- 5 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 pkg/arvo/gen/hood/wham.hoon diff --git a/pkg/arvo/gen/hood/wham.hoon b/pkg/arvo/gen/hood/wham.hoon new file mode 100644 index 000000000..90bfe7a5f --- /dev/null +++ b/pkg/arvo/gen/hood/wham.hoon @@ -0,0 +1,9 @@ +:- %say +|= [^ [=ship pax=$@(~ [=path ~])] ~] +=/ =path + :: XX remove default path + ?~ pax /c/x/1/kids/sys/kelvin + ?> ?=([@ *] path.pax) + =, pax + path +[%helm-pass %a %wham ship path] diff --git a/pkg/arvo/gen/hood/yawn.hoon b/pkg/arvo/gen/hood/yawn.hoon index 9eb7c7bf9..deea1950f 100644 --- a/pkg/arvo/gen/hood/yawn.hoon +++ b/pkg/arvo/gen/hood/yawn.hoon @@ -1,9 +1,9 @@ :- %say -|= [^ [=ship all=? pax=$@(~ [=path ~])] ~] +|= [^ [=ship pax=$@(~ [=path ~])] ~] =/ =path :: XX remove default path ?~ pax /c/x/1/kids/sys/kelvin ?> ?=([@ *] path.pax) =, pax path -[%helm-pass %a %yawn ship path all] +[%helm-pass %a %yawn ship path] diff --git a/pkg/arvo/sys/lull.hoon b/pkg/arvo/sys/lull.hoon index e7ab9f513..d185e0577 100644 --- a/pkg/arvo/sys/lull.hoon +++ b/pkg/arvo/sys/lull.hoon @@ -1078,6 +1078,7 @@ :: %keen: data request from arvo :: %pine: scries for the latest case of a path :: %yawn: cancel request from arvo + :: %wham: cancels all scry request from any vane :: :: System and Lifecycle Tasks :: @@ -1102,7 +1103,8 @@ :: [%keen =ship =path] [%pine =ship =path] - [%yawn =ship =path all=?] + [%yawn =ship =path] + [%wham =ship =path] :: $>(%born vane-task) $>(%init vane-task) diff --git a/pkg/arvo/sys/vane/ames.hoon b/pkg/arvo/sys/vane/ames.hoon index 1f6431123..28a0c530a 100644 --- a/pkg/arvo/sys/vane/ames.hoon +++ b/pkg/arvo/sys/vane/ames.hoon @@ -2277,11 +2277,11 @@ |= todos=alien-agenda todos(keens (~(put ju keens.todos) path duct)) :: - ++ on-yawn - |= [=ship =path all=?] + ++ on-cancel-scry + |= [all=? =ship =path] ^+ event-core ?~ ship-state=(~(get by peers.ames-state) ship) - ~|(%no-ship-for-yawn !!) + ~|(%cancel-scry-missing^ship^path !!) ?> ?=([%known *] u.ship-state) fi-abet:ke-abet:(ke-unsub:(ke-abed:ke:fi:(abed:pe ship) path) duct all) :: @@ -4335,7 +4335,8 @@ :: %pine (on-pine:event-core +.task) %keen (on-keen:event-core +.task) - %yawn (on-yawn:event-core +.task) + %yawn (on-cancel-scry:event-core | +.task) + %wham (on-cancel-scry:event-core & +.task) == :: [moves ames-gate] diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index cad48b8ec..9e37e4a47 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -3245,7 +3245,7 @@ =* bus u.busy.sat =/ =wire (request-wire kind.bus her syd u.nux) ~& %cancel-request-yawn - :~ [hen %pass wire %a %yawn her path.bus |] + :~ [hen %pass wire %a %yawn her path.bus] [hen %pass wire %b %rest time.bus] == :: @@ -3291,7 +3291,7 @@ %- emil ~& %retry-with-ames-yawn :~ [hen %pass wire %b %rest time.bus] - [hen %pass wire %a %yawn her path.bus |] + [hen %pass wire %a %yawn her path.bus] == :: re-send over ames ::