ph: get boot-az working

This commit is contained in:
Philip Monk 2019-11-14 13:31:44 -08:00
parent 32ea09caf2
commit 4cb821de11
No known key found for this signature in database
GPG Key ID: B66E1F02604E44EC
7 changed files with 49 additions and 24 deletions

View File

@ -92,7 +92,6 @@
%watch
:: fully restart the watchdog if it doesn't exist yet,
:: or if the new config changes more than just the url.
~& > %ouch
=/ restart=?
?| !(~(has by dogs.state) path.poke)
?! .= ->:(~(got by dogs.state) path.poke)

View File

@ -5,8 +5,8 @@
+$ card card:agent:mall
+$ imp-thread imp:spider
+$ iid iid:spider
+$ imput imput:spider
+$ imp (list iid)
+$ imput [=imp =cage]
+$ imp-form _*eval-form:eval:(thread ,vase)
+$ trie
$~ [*imp-form ~]
@ -92,7 +92,7 @@
%+ welp
?~ imp
~
[imp imp-form.trie]~
[(flop imp) imp-form.trie]~
=/ kids ~(tap by kid.trie)
|- ^- (list [=^imp =imp-form])
?~ kids
@ -189,6 +189,7 @@
|_ =bowl:mall
++ on-poke-imput
|= imput
=/ imp (~(got by iid.state) iid)
(take-input imp ~ %poke cage)
::
++ on-watch
@ -223,7 +224,7 @@
?~ parent-iid
/
(~(got by iid.state) u.parent-iid)
=/ new-iid (fall use (scot %uv eny.bowl))
=/ new-iid (fall use (scot %uv (sham eny.bowl)))
=/ =imp (snoc parent-imp new-iid)
::
?: (has-imp running.state imp)

View File

@ -4,8 +4,8 @@
^- imp:spider
|= [=bowl:spider vase]
=/ m (thread ,vase)
;< ~ bind:m start-azimuth
;< ~ bind:m (spawn ~bud)
;< ~ bind:m (real-ship ~bud)
;< ~ bind:m end-azimuth
;< az=iid:spider bind:m start-azimuth
;< ~ bind:m (spawn az ~bud)
;< ~ bind:m (real-ship az ~bud)
;< ~ bind:m end-azimuth
(pure:m *vase)

View File

@ -81,11 +81,15 @@
^- (list term)
?: lit
:~ %dojo
:: %eth-watcher
:: %azimuth-tracker
%spider
%eth-watcher
%azimuth-tracker
==
:~ %dojo
%lens
%eth-watcher
%azimuth-tracker
%clock
==
:: %+ welp
:: ?: ?=(%pawn (clan:title our)) ~
@ -99,7 +103,6 @@
:: %modulo
:: %launch
:: %publish
:: %clock
:: %weather
:: %group-store
:: %group-hook

View File

@ -21,7 +21,11 @@
(end-test %aqua-ames %aqua-behn %aqua-dill %aqua-eyre ~)
::
++ start-azimuth
(start-test %aqua-ames %aqua-behn %aqua-dill %aqua-eyre-azimuth ~)
=/ m (thread ,iid:spider)
^- form:m
;< ~ bind:m (start-test %aqua-ames %aqua-behn %aqua-dill ~)
(start-imp %aqua-eyre-azimuth)
::
++ end-azimuth
(end-test %aqua-ames %aqua-behn %aqua-dill %aqua-eyre-azimuth ~)
::
@ -63,7 +67,6 @@
=* loop $
?~ imps
(pure:m ~)
;< now=@da bind:m get-time
=/ poke-vase !>([`iid.bowl ~ i.imps *vase])
;< ~ bind:m (poke-our %spider %spider-start poke-vase)
loop(imps t.imps)
@ -75,31 +78,33 @@
(pure:m ~)
::
++ spawn
|= =ship
|= [=iid:spider =ship]
~& > "spawning {<ship>}"
=/ m (thread ,~)
=/ =vase !>([%aqua-eyre-azimuth %azimuth-command !>([%spawn ship])])
=/ =vase !>(`imput:spider`[iid %azimuth-command !>([%spawn ship])])
(poke-our %spider %spider-imput vase)
::
++ breach
|= who=ship
|= [=iid:spider who=ship]
=/ m (thread ,~)
~& > "breaching {<who>}"
=/ =vase
!>([%aqua-eyre-azimuth %azimuth-command !>([%breach who])])
!>([iid %azimuth-command !>([%breach who])])
(poke-our %spider %spider-imput vase)
::
++ breach-and-hear
|= [who=ship her=ship]
|= [=iid:spider who=ship her=ship]
=/ m (thread ,~)
~& > "breaching {<who>} for {<her>}"
=/ =vase
!>([%aqua-eyre-azimuth %azimuth-command !>([%breach-and-hear who her])])
!>([iid %azimuth-command !>([%breach-and-hear who her])])
(poke-our %spider %spider-imput vase)
::
++ real-ship
|= =ship
|= [=iid:spider =ship]
~& > "booting real {<ship>}"
=/ m (thread ,~)
=/ =vase !>([%aqua-eyre-azimuth %azimuth-command !>([%create-ship ship])])
=/ =vase !>([iid %azimuth-command !>([%create-ship ship])])
;< ~ bind:m (poke-our %spider %spider-imput vase)
(check-ship-booted ship)
::

View File

@ -1,3 +1,4 @@
/- spider
/+ libthread=thread
=, thread=thread:libthread
=, thread-fail=thread-fail:libthread
@ -488,4 +489,19 @@
=/ m (thread ,~)
^- form:m
(send-raw-card %pass / %arvo %e %rule %turf %put turf)
::
:: ----
::
:: Imps
::
++ start-imp
|= file=term
=/ m (thread ,iid:spider)
^- form:m
;< =bowl:spider bind:m get-bowl
=/ iid (scot %ta (cat 3 'thread_' (scot %uv (sham file eny.bowl))))
=/ poke-vase !>([`iid.bowl `iid file *vase])
;< ~ bind:m (poke-our %spider %spider-start poke-vase)
;< ~ bind:m (sleep ~s0) :: wait for imp to start
(pure:m iid)
--

View File

@ -1,7 +1,8 @@
/+ libthread=thread
=, thread=thread:libthread
|%
+$ imp $-([bowl vase] _*form:(thread ,vase))
+$ iid iid:thread
+$ bowl bowl:thread
+$ imp $-([bowl vase] _*form:(thread ,vase))
+$ imput [=iid =cage]
+$ iid iid:thread
+$ bowl bowl:thread
--