khan: vane skeleton

This commit is contained in:
Jōshin 2022-01-21 18:48:05 +00:00
parent 0c9fc76b93
commit 575ff61fa6
No known key found for this signature in database
GPG Key ID: A8BE5A9A521639D0
3 changed files with 75 additions and 0 deletions

View File

@ -1678,6 +1678,7 @@
%g %gall
%i %iris
%j %jael
%k %khan
==
-- =>
::

View File

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

View 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]
--