From 575ff61fa6d2b84f2c0513d28d670763cb1c41dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Fri, 21 Jan 2022 18:48:05 +0000 Subject: [PATCH] khan: vane skeleton --- pkg/arvo/sys/arvo.hoon | 1 + pkg/arvo/sys/lull.hoon | 20 ++++++++++++++ pkg/arvo/sys/vane/khan.hoon | 54 +++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 pkg/arvo/sys/vane/khan.hoon diff --git a/pkg/arvo/sys/arvo.hoon b/pkg/arvo/sys/arvo.hoon index 3c85edda6c..56afbbd65f 100644 --- a/pkg/arvo/sys/arvo.hoon +++ b/pkg/arvo/sys/arvo.hoon @@ -1678,6 +1678,7 @@ %g %gall %i %iris %j %jael + %k %khan == -- => :: diff --git a/pkg/arvo/sys/lull.hoon b/pkg/arvo/sys/lull.hoon index cef2295a14..50a857a99f 100644 --- a/pkg/arvo/sys/lull.hoon +++ b/pkg/arvo/sys/lull.hoon @@ -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 :: diff --git a/pkg/arvo/sys/vane/khan.hoon b/pkg/arvo/sys/vane/khan.hoon new file mode 100644 index 0000000000..52ceab7f9c --- /dev/null +++ b/pkg/arvo/sys/vane/khan.hoon @@ -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] +--