On this page:
12.1 Mutable Future Queue
mfqueue?
make-mfqueue
mfqueue-enqueue!
mfqueue-dequeue!
8.10

12 RRLL: Mutable Future Queue

Dominik Pantůček <dominik.pantucek@trustica.cz>

Racket Rogue-Like Library: Mutable Future Queue

Special type of mutable queue that can be used to send work to running futures.

12.1 Mutable Future Queue

 (require rrll/mfqueue) package: rrll-mfqueue

This module contains the whole implementation.

procedure

(mfqueue? v)  boolean?

  v : any/c
A predicate returning #t if given value is an instance of mutable future queue.

procedure

(make-mfqueue)  mfqueue?

Creates a new, empty mfqueue?.

procedure

(mfqueue-enqueue! mfq v)  void?

  mfq : mfqueue?
  v : any/c
Enqueues element in mutable future queue and signals it availability to the consuming future.

This procedure should be used outside of any future.

procedure

(mfqueue-dequeue! mfq)  any/c

  mfq : mfqueue?
If there are no elements awaiting in the mfq mutable future queue, pauses the consuming future until it is available.

Dequeues the next element from the mutable future queue and returns it.

This procedure should be used within the consuming future.