From aba3ea8055a127bfc577930cf68cdbdb36146d8e Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Wed, 30 Oct 2019 11:16:55 -0700 Subject: [PATCH] dns: sends notifications directly to %dill (and adds tapp support) --- pkg/arvo/app/dns.hoon | 20 +++++++++++++++----- pkg/arvo/lib/stdio.hoon | 29 +++++++++++++++++++++++++++++ pkg/arvo/sur/tapp.hoon | 1 + 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/pkg/arvo/app/dns.hoon b/pkg/arvo/app/dns.hoon index ce18638766..f610617ebf 100644 --- a/pkg/arvo/app/dns.hoon +++ b/pkg/arvo/app/dns.hoon @@ -93,7 +93,17 @@ (pure:m |) loop(try +(try)) :: - ++ hall-app-message + ++ app-message + |= [app=term =cord =tang] + =/ m (async:stdio ,~) + ^- form:m + =/ msg=tape :(weld (trip app) ": " (trip cord)) + ;< ~ bind:m (flog-text:stdio msg) + (flog-tang:stdio tang) + :: + :: XX disabled due to :hall's status + :: + ++ hall-app-message-disabled |= [app=term =cord =tang] =/ m (async:stdio ,~) ^- form:m @@ -148,7 +158,7 @@ :~ leaf+"XX check via nslookup" leaf+"XX confirm port 80" == - ;< ~ bind:m (hall-app-message %dns msg) + ;< ~ bind:m (app-message %dns msg) loop(ames-domains t.ames-domains) :: :: +request-by-ip @@ -242,7 +252,7 @@ :~ leaf+"XX check via nslookup" leaf+"XX confirm port 80" == - ;< ~ bind:m (hall-app-message %dns msg) + ;< ~ bind:m (app-message %dns msg) =? completed.state good (some binding) :: XX save failure?s :: XX unsubscribe? @@ -263,7 +273,7 @@ ?~ error.sign =/ msg=cord (cat 3 'request for DNS sent to ' (scot %p p:collector-app)) - ;< ~ bind:m (hall-app-message %dns msg ~) + ;< ~ bind:m (app-message %dns msg ~) (pure:m state) :: XX details ~& %dns-ip-request-failed @@ -284,7 +294,7 @@ ?~ error.sign =/ msg=cord (cat 3 'awaiting response from ' (scot %p p:collector-app)) - ;< ~ bind:m (hall-app-message %dns msg ~) + ;< ~ bind:m (app-message %dns msg ~) (pure:m state) :: XX details ~& %dns-domain-subscription-failed diff --git a/pkg/arvo/lib/stdio.hoon b/pkg/arvo/lib/stdio.hoon index 1c8a840a11..e6e427030f 100644 --- a/pkg/arvo/lib/stdio.hoon +++ b/pkg/arvo/lib/stdio.hoon @@ -344,6 +344,35 @@ :: :: ---- :: +:: Output +:: +++ flog + |= =flog:dill + =/ m (async ,~) + ^- form:m + (send-raw-card %flog / flog) +:: +++ flog-text + |= =tape + =/ m (async ,~) + ^- form:m + (flog %text tape) +:: +++ flog-tang + |= =tang + =/ m (async ,~) + ^- form:m + =/ =wall + (zing (turn (flop tang) (cury wash [0 80]))) + |- ^- form:m + =* loop $ + ?~ wall + (pure:m ~) + ;< ~ bind:m (flog-text i.wall) + loop(wall t.wall) +:: +:: ---- +:: :: Apps :: ++ poke-app diff --git a/pkg/arvo/sur/tapp.hoon b/pkg/arvo/sur/tapp.hoon index 20569e4f88..e9be6a2b90 100644 --- a/pkg/arvo/sur/tapp.hoon +++ b/pkg/arvo/sur/tapp.hoon @@ -20,6 +20,7 @@ [%sources wire ~] [%new-event wire =ship =udiff:point:able:jael] [%listen wire whos=(set ship) =source:jael] + [%flog wire flog:dill] == :: :: Possible async responses