Merge pull request #4577 from tinnus-napbus/strandio-fix-await-thread

strandio: fix await-thread and thread-result
This commit is contained in:
matildepark 2021-03-11 14:02:10 -05:00 committed by GitHub
commit ff21e29594
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -719,7 +719,7 @@
(pure:m tid) (pure:m tid)
:: ::
+$ thread-result +$ thread-result
(each vase [term (list tang)]) (each vase [term tang])
:: ::
++ await-thread ++ await-thread
|= [file=term args=vase] |= [file=term args=vase]
@ -727,14 +727,14 @@
^- form:m ^- form:m
;< =bowl:spider bind:m get-bowl ;< =bowl:spider bind:m get-bowl
=/ tid (scot %ta (cat 3 'strand_' (scot %uv (sham file eny.bowl)))) =/ tid (scot %ta (cat 3 'strand_' (scot %uv (sham file eny.bowl))))
=/ tid (scot %ta (cat 3 'strand_' (scot %uv (sham file eny.bowl))))
=/ poke-vase !>([`tid.bowl `tid file args]) =/ poke-vase !>([`tid.bowl `tid file args])
;< ~ bind:m (watch-our /awaiting/[tid] %spider /thread-result/[tid]) ;< ~ bind:m (watch-our /awaiting/[tid] %spider /thread-result/[tid])
;< ~ bind:m (poke-our %spider %spider-start poke-vase) ;< ~ bind:m (poke-our %spider %spider-start poke-vase)
;< ~ bind:m (sleep ~s0) :: wait for thread to start ;< ~ bind:m (sleep ~s0) :: wait for thread to start
;< =cage bind:m (take-fact /awaiting/[tid]) ;< =cage bind:m (take-fact /awaiting/[tid])
;< ~ bind:m (take-kick /awaiting/[tid])
?+ p.cage ~|([%strange-thread-result p.cage file tid] !!) ?+ p.cage ~|([%strange-thread-result p.cage file tid] !!)
%thread-done (pure:m %& q.cage) %thread-done (pure:m %& q.cage)
%thread-fail (pure:m %| !<([term (list tang)] q.cage)) %thread-fail (pure:m %| !<([term tang] q.cage))
== ==
-- --