Module

Concurrent.BoundedQueue.Sync

#new

new :: forall a. Int -> Effect (BoundedQueue a)

Synchronously creates a new BoundedQueue with the given capacity.

#isEmpty

isEmpty :: forall a. BoundedQueue a -> Effect Boolean

Synchronously checks whether the given queue is empty. Never blocks.

#tryRead

tryRead :: forall a. BoundedQueue a -> Effect (Maybe a)

Synchronously attempts to read an element from the given queue. If the queue is empty, or there is a concurrent reader, returns Nothing.

#tryWrite

tryWrite :: forall a. BoundedQueue a -> a -> Effect Boolean

Attempts to write an element into the given queue. If the queue is full, or there is a concurrent writer, returns false otherwise true.

Re-exports from Concurrent.BoundedQueue.Internal

#BoundedQueue

newtype BoundedQueue a

Modules