khan: accepts thread arguments with marks

This commit is contained in:
Jōshin 2022-01-26 16:26:30 -08:00
parent 8ad57d8bd2
commit 425bf6b011
No known key found for this signature in database
GPG Key ID: A8BE5A9A521639D0
2 changed files with 22 additions and 20 deletions

View File

@ -2093,22 +2093,25 @@
-- :: pki -- :: pki
-- :: jael -- :: jael
:: :::: :: ::::
:::: ++khan :: (1i) threads :::: ++khan :: (1i) threads
:: :::: :: ::::
++ khan ^? ++ khan ^?
|% |%
+$ gift :: out result <-$ +$ gift :: out result <-$
$% [%avow p=(each [mark noun] [term tang])] :: thread result $% [%avow p=(each (cask) goof)] :: thread result
== == ::
+$ task :: in request ->$ +$ task :: in request ->$
$~ [%vega ~] $~ [%vega ~] ::
$% $>(%born vane-task) :: new unix process $% $>(%born vane-task) :: new unix process
[%done ~] :: socket closed [%done ~] :: socket closed
[%fyrd =desk name=term data=*] :: run thread v0 [%fyrd p=fyrd] :: run thread
$>(%trim vane-task) :: trim state $>(%trim vane-task) :: trim state
$>(%vega vane-task) :: report upgrade $>(%vega vane-task) :: report upgrade
== == ::
-- :: khan :: ::
+$ bear $@(=desk [=desk =case]) :: local desk/case
+$ fyrd [=bear name=term =mark data=(cask)] :: run-thread request
-- ::khan
:: ::
+$ gift-arvo :: out result <-$ +$ gift-arvo :: out result <-$
$~ [%doze ~] $~ [%doze ~]

View File

@ -53,24 +53,23 @@
%born %born
[~ khan-gate(unix-duct hen)] [~ khan-gate(unix-duct hen)]
%fyrd %fyrd
:: start the thread on %spider.
::
=/ wir=wire (head hen) =/ wir=wire (head hen)
=/ rid=@ta (rear wir) =/ rid=@ta (rear wir)
:: XX what if the client sends a duplicate rid? =* fyd p.task
:: is this fine? should we inject some randomness?
::
=/ tid=@ta =/ tid=@ta
(cat 3 'khan-fyrd--' rid) (cat 3 'khan-fyrd--' rid)
=/ =beak
?@(bear.fyd [our bear.fyd %da now] [our bear.fyd])
=/ =dais:clay
?~ ret=(rof ~ %cb beak /[p.data.fyd])
~|(%mark-unknown !!)
?~ u.ret
~|(%mark-invalid !!)
?> =(%dais p.u.u.ret)
!<(dais:clay q.u.u.ret)
=/ args =/ args
:* ~ `tid [our desk.task %da now] name.task :* ~ `tid beak name.fyd
:: XX can't do this: (vale.dais q.data.fyd)
::
:: !>(data.task)
::
:: special case for -hi:
::
!>(;;([~ arg=$@(who=ship [who=ship mez=tape])] data.task))
== ==
=/ start-moves=(list move) =/ start-moves=(list move)
%+ turn %+ turn