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
-- :: jael
:: ::::
:::: ++khan :: (1i) threads
:::: ++khan :: (1i) threads
:: ::::
++ khan ^?
|%
+$ gift :: out result <-$
$% [%avow p=(each [mark noun] [term tang])] :: thread result
==
$% [%avow p=(each (cask) goof)] :: thread result
== ::
+$ task :: in request ->$
$~ [%vega ~]
$~ [%vega ~] ::
$% $>(%born vane-task) :: new unix process
[%done ~] :: socket closed
[%fyrd =desk name=term data=*] :: run thread v0
[%fyrd p=fyrd] :: run thread
$>(%trim vane-task) :: trim state
$>(%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 <-$
$~ [%doze ~]

View File

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