dns: sends notifications directly to %dill (and adds tapp support)

This commit is contained in:
Joe Bryan 2019-10-30 11:16:55 -07:00
parent fe8a7f0a33
commit aba3ea8055
3 changed files with 45 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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