Module

Concurrent.Queue

An unbounded FIFO data structure for concurrent access.

#Queue

newtype Queue a

An unbounded Queue fit for concurrent access.

#new

new :: forall a. Aff (Queue a)

Creates a new Queue.

#read

read :: forall a. Queue a -> Aff a

Reads a value from the queue. Blocks if the queue is empty, and resumes when it has been written to.

#write

write :: forall a. Queue a -> a -> Aff Unit

Writes a new value into the queue

#tryRead

tryRead :: forall a. Queue a -> Aff (Maybe a)

Attempts to read a value from the queue. Fails with Nothing if the queue is empty.

CAREFUL! This will block if other readers are blocked on the queue.

Modules