mirror of
https://github.com/urbit/shrub.git
synced 2025-01-07 05:26:56 +03:00
khan: vane skeleton
This commit is contained in:
parent
0c9fc76b93
commit
575ff61fa6
@ -1678,6 +1678,7 @@
|
|||||||
%g %gall
|
%g %gall
|
||||||
%i %iris
|
%i %iris
|
||||||
%j %jael
|
%j %jael
|
||||||
|
%k %khan
|
||||||
==
|
==
|
||||||
-- =>
|
-- =>
|
||||||
::
|
::
|
||||||
|
@ -2092,6 +2092,22 @@
|
|||||||
+$ oath @ :: signature
|
+$ oath @ :: signature
|
||||||
-- :: pki
|
-- :: pki
|
||||||
-- :: jael
|
-- :: jael
|
||||||
|
:: ::::
|
||||||
|
:::: ++khan :: (1i) threads
|
||||||
|
:: ::::
|
||||||
|
++ khan ^?
|
||||||
|
|%
|
||||||
|
+$ gift :: out result <-$
|
||||||
|
$% [%avow ~]
|
||||||
|
==
|
||||||
|
+$ task :: in request ->$
|
||||||
|
$~ [%vega ~]
|
||||||
|
$% $>(%born vane-task) :: new unix process
|
||||||
|
[%fyrd ~]
|
||||||
|
$>(%trim vane-task) :: trim state
|
||||||
|
$>(%vega vane-task) :: report upgrade
|
||||||
|
==
|
||||||
|
-- :: khan
|
||||||
::
|
::
|
||||||
+$ gift-arvo :: out result <-$
|
+$ gift-arvo :: out result <-$
|
||||||
$~ [%doze ~]
|
$~ [%doze ~]
|
||||||
@ -2103,6 +2119,7 @@
|
|||||||
gift:gall
|
gift:gall
|
||||||
gift:iris
|
gift:iris
|
||||||
gift:jael
|
gift:jael
|
||||||
|
gift:khan
|
||||||
==
|
==
|
||||||
+$ task-arvo :: in request ->$
|
+$ task-arvo :: in request ->$
|
||||||
$% task:ames
|
$% task:ames
|
||||||
@ -2113,6 +2130,7 @@
|
|||||||
task:gall
|
task:gall
|
||||||
task:iris
|
task:iris
|
||||||
task:jael
|
task:jael
|
||||||
|
task:khan
|
||||||
==
|
==
|
||||||
+$ note-arvo :: out request $->
|
+$ note-arvo :: out request $->
|
||||||
$~ [%b %wake ~]
|
$~ [%b %wake ~]
|
||||||
@ -2124,6 +2142,7 @@
|
|||||||
[%g task:gall]
|
[%g task:gall]
|
||||||
[%i task:iris]
|
[%i task:iris]
|
||||||
[%j task:jael]
|
[%j task:jael]
|
||||||
|
[%k task:khan]
|
||||||
[%$ %whiz ~]
|
[%$ %whiz ~]
|
||||||
[@tas %meta vase]
|
[@tas %meta vase]
|
||||||
==
|
==
|
||||||
@ -2145,6 +2164,7 @@
|
|||||||
[%gall gift:gall]
|
[%gall gift:gall]
|
||||||
[%iris gift:iris]
|
[%iris gift:iris]
|
||||||
[%jael gift:jael]
|
[%jael gift:jael]
|
||||||
|
[%khan gift:khan]
|
||||||
==
|
==
|
||||||
:: $unix-task: input from unix
|
:: $unix-task: input from unix
|
||||||
::
|
::
|
||||||
|
54
pkg/arvo/sys/vane/khan.hoon
Normal file
54
pkg/arvo/sys/vane/khan.hoon
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
:: %khan, thread runner
|
||||||
|
!:
|
||||||
|
!? 164
|
||||||
|
::
|
||||||
|
|= our=ship
|
||||||
|
=> |%
|
||||||
|
+$ move [p=duct q=(wite note gift:khan)]
|
||||||
|
+$ note :: out request $->
|
||||||
|
!!
|
||||||
|
+$ sign :: in response $<-
|
||||||
|
!!
|
||||||
|
+$ khan-state
|
||||||
|
$: %0
|
||||||
|
unix-duct=duct
|
||||||
|
==
|
||||||
|
--
|
||||||
|
=| khan-state
|
||||||
|
=* state -
|
||||||
|
|= [now=@da eny=@uvJ rof=roof]
|
||||||
|
=* khan-gate .
|
||||||
|
^?
|
||||||
|
|%
|
||||||
|
:: +call: handle a +task:khan request
|
||||||
|
::
|
||||||
|
++ call
|
||||||
|
|= $: hen=duct
|
||||||
|
dud=(unit goof)
|
||||||
|
wrapped-task=(hobo task:khan)
|
||||||
|
==
|
||||||
|
^- [(list move) _khan-gate]
|
||||||
|
::
|
||||||
|
=/ =task:khan ((harden task:khan) wrapped-task)
|
||||||
|
[~ khan-gate]
|
||||||
|
:: +load: migrate an old state to a new khan version
|
||||||
|
::
|
||||||
|
++ load
|
||||||
|
|= old=khan-state
|
||||||
|
^+ khan-gate
|
||||||
|
khan-gate(state old)
|
||||||
|
:: +scry: view khan state
|
||||||
|
::
|
||||||
|
++ scry
|
||||||
|
^- roon
|
||||||
|
|= [lyc=gang car=term bem=beam]
|
||||||
|
^- (unit (unit cage))
|
||||||
|
~
|
||||||
|
++ stay state
|
||||||
|
++ take
|
||||||
|
|= [tea=wire hen=duct dud=(unit goof) hin=sign]
|
||||||
|
^- [(list move) _khan-gate]
|
||||||
|
?^ dud
|
||||||
|
~|(%khan-take-dud (mean tang.u.dud))
|
||||||
|
[~ khan-gate]
|
||||||
|
--
|
Loading…
Reference in New Issue
Block a user