Commit 07383294 authored by Julien Lepiller's avatar Julien Lepiller

utils: Add fiber for non-blocking message passing.

* torrent/utils/fibers.scm (put-nonblocking): New procedure.
parent 9e348b30
......@@ -18,9 +18,10 @@
(define-module (torrent utils fibers)
#:use-module (ice-9 match)
#:use-module (fibers)
#:use-module (fibers channels)
#:use-module (fibers operations)
#:use-module (fibers timers)
#:export (timeout-perform-operation))
#:export (timeout-perform-operation put-nonblocking))
(define (timeout-perform-operation time op)
(catch
......@@ -35,3 +36,8 @@
(val val)))
(lambda _
'timeout)))
(define (put-nonblocking channel message)
(spawn-fiber
(lambda ()
(put-message channel message))))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment