diff --git a/pkg/arvo/app/link-listen-hook.hoon b/pkg/arvo/app/link-listen-hook.hoon index 1c0f32007d..948aadc572 100644 --- a/pkg/arvo/app/link-listen-hook.hoon +++ b/pkg/arvo/app/link-listen-hook.hoon @@ -75,9 +75,25 @@ =^ cards state (take-forward-sign:do t.wire sign) [cards this] + ?: ?=([%prod *] wire) + ~| [%weird-sign -.sign] + ?> ?=(%poke-ack -.sign) + ?~ p.sign [~ this] + %- (slog [leaf+"failed to prod" u.p.sign]) + [~ this] ~| [dap.bowl %weird-wire wire] !! :: + ++ on-poke + |= [=mark =vase] + ?. ?=(%link-listen-poke mark) + (on-poke:def mark vase) + =/ =path !<(path vase) + :_ this + %+ weld + (take-retry:do %local-pages src.bowl path) + (take-retry:do %annotations src.bowl path) + :: ++ on-arvo |= [=wire =sign-arvo] ^- (quip card _this) @@ -98,7 +114,6 @@ (take-retry:do (wire-to-target t.wire)) == :: - ++ on-poke on-poke:def ++ on-peek on-peek:def ++ on-watch on-watch:def ++ on-leave on-leave:def @@ -168,8 +183,9 @@ %+ weld $(whos t.whos) (end-link-subscriptions i.whos pax.upd) - :+ (start-link-subscription %local-pages i.whos pax.upd) - (start-link-subscription %annotations i.whos pax.upd) + :^ (start-link-subscription %local-pages i.whos pax.upd) + (start-link-subscription %annotations i.whos pax.upd) + (prod-other-listener i.whos pax.upd) $(whos t.whos) == :: @@ -205,6 +221,18 @@ == -- :: +++ prod-other-listener + |= [who=ship where=path] + ^- card + :* %pass + [%prod (scot %p who) where] + %agent + [who %link-listen-hook] + %poke + %link-listen-poke + !>(where) + == +:: ++ take-link-sign |= [=target =sign:agent:gall] ^- (quip card _state) @@ -261,7 +289,7 @@ ?. relevant ~ [(start-link-subscription target)]~ ?: %- ~(has by wex.bowl) - [[%links (target-to-wire target)] who.target %group-store] + [[%links (target-to-wire target)] who.target %link-proxy-hook] | %. who.target %~ has in diff --git a/pkg/arvo/app/link-proxy-hook.hoon b/pkg/arvo/app/link-proxy-hook.hoon index 05691a711e..49341c2a5b 100644 --- a/pkg/arvo/app/link-proxy-hook.hoon +++ b/pkg/arvo/app/link-proxy-hook.hoon @@ -114,13 +114,8 @@ ?& ?=(^ group) (~(has in u.group) who) == - .^ (unit group:group-store) - %gx - (scot %p our.bowl) - %group-store - (scot %da now.bowl) - (snoc u.target %noun) - == + %+ scry-for (unit group:group-store) + [%group-store u.target] :: :: groups subscription ::TODO largely copied from link-listen-hook. maybe make a store-listener lib? @@ -216,10 +211,14 @@ [%give %fact ~ %link-initial !>(initial)] ?+ path !! [%local-pages ^] - [%local-pages .^((map ^path pages) %gx path)] + :- %local-pages + %+ scry-for (map ^path pages) + [%link-store path] :: - [%annotations ~ ^] - [%annotations .^((per-path-url notes) %gx '' t.t.path)] + [%annotations %$ ^] + :- %annotations + %+ scry-for (per-path-url notes) + [%link-store path] == :: ++ start-proxy @@ -249,4 +248,14 @@ :: else, close the local subscription. :: [(proxy-pass-link-store path %leave ~)]~ +:: +++ scry-for + |* [=mold app=term =path] + .^ mold + %gx + (scot %p our.bowl) + app + (scot %da now.bowl) + (snoc `^path`path %noun) + == -- diff --git a/pkg/arvo/mar/link/listen-poke.hoon b/pkg/arvo/mar/link/listen-poke.hoon new file mode 100644 index 0000000000..b7ece7a388 --- /dev/null +++ b/pkg/arvo/mar/link/listen-poke.hoon @@ -0,0 +1,12 @@ +:: link-listen-poke: prod another listener into paying attention +:: +|_ =path +++ grow + |% + ++ noun path + -- +++ grab + |% + ++ noun ^path + -- +--