mirror of
https://github.com/urbit/shrub.git
synced 2025-01-03 01:54:43 +03:00
khan: vane skeleton
This commit is contained in:
parent
0c9fc76b93
commit
575ff61fa6
@ -1678,6 +1678,7 @@
|
||||
%g %gall
|
||||
%i %iris
|
||||
%j %jael
|
||||
%k %khan
|
||||
==
|
||||
-- =>
|
||||
::
|
||||
|
@ -2092,6 +2092,22 @@
|
||||
+$ oath @ :: signature
|
||||
-- :: pki
|
||||
-- :: 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 <-$
|
||||
$~ [%doze ~]
|
||||
@ -2103,6 +2119,7 @@
|
||||
gift:gall
|
||||
gift:iris
|
||||
gift:jael
|
||||
gift:khan
|
||||
==
|
||||
+$ task-arvo :: in request ->$
|
||||
$% task:ames
|
||||
@ -2113,6 +2130,7 @@
|
||||
task:gall
|
||||
task:iris
|
||||
task:jael
|
||||
task:khan
|
||||
==
|
||||
+$ note-arvo :: out request $->
|
||||
$~ [%b %wake ~]
|
||||
@ -2124,6 +2142,7 @@
|
||||
[%g task:gall]
|
||||
[%i task:iris]
|
||||
[%j task:jael]
|
||||
[%k task:khan]
|
||||
[%$ %whiz ~]
|
||||
[@tas %meta vase]
|
||||
==
|
||||
@ -2145,6 +2164,7 @@
|
||||
[%gall gift:gall]
|
||||
[%iris gift:iris]
|
||||
[%jael gift:jael]
|
||||
[%khan gift:khan]
|
||||
==
|
||||
:: $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