Handbook
Glossary
spawn-server ( quot name -- thread )
Factor handbook
»
The language
»
Co-operative threads
»
Starting and stopping threads
Prev:
spawn ( quot name -- thread )
Next:
<thread> ( quot name -- thread )
Vocabulary
threads
Inputs
quot
a
quotation
with stack effect
( -- ? )
name
a
string
Outputs
thread
a
thread
Word description
Convenience wrapper around
spawn
which repeatedly calls the quotation in a new thread until it outputs
f
.
Examples
A thread that runs forever:
[ do-foo-bar t ] "Foo bar server" spawn-server
Definition
USING:
kernel
;
IN:
threads
:
spawn-server
( quot name -- thread )
[
[
loop
]
curry
]
dip
spawn
;