Paste: coroutines IO

Author: me
Mode: factor
Date: Wed, 11 Sep 2019 12:36:22
Plain Text |
USING: kernel threads io io.files io.encodings.utf8 ;
IN: test

: read-fifo ( -- )
    "fifo" utf8 [ readln print flush ] with-file-reader read-fifo ;

: read-stdin ( -- )
    readln print flush read-stdin ;

[ read-fifo ] "fifo-thread" spawn drop
read-stdin

New Annotation

Summary:
Author:
Mode:
Body: