Module
IxQueue
- Package
- purescript-queue
- Repository
- athanclark/purescript-queue
Queues with an indexed mapping of handlers - this is useful for sending messages to a set of recipients, either discriminately or via broadcast, where removing them individually from the queue is also necessary. This could be useful in interfaces where the set of listening handlers is unknown and dynamic, mimicking global access to updated values.
#broadcastMany Source
broadcastMany :: forall t rw a. Traversable t => IxQueue (write :: WRITE | rw) a -> t a -> Effect Unit
#broadcastManyExcept Source
broadcastManyExcept :: forall t rw a. Traversable t => IxQueue (write :: WRITE | rw) a -> Array String -> t a -> Effect Unit
Application policy is such that the inputs will be applied uniformly to all handlers, sorted by
#readBroadcast Source
readBroadcast :: forall rw a. IxQueue rw a -> Effect (Array a)
Read only broadcast pending values (if any), without removing them from the queue.
#takeBroadcast Source
takeBroadcast :: forall rw a. IxQueue (write :: WRITE | rw) a -> Effect (Maybe a)
#takeBroadcastAll Source
takeBroadcastAll :: forall rw a. IxQueue (write :: WRITE | rw) a -> Effect (Array a)
Removes only the globally pending inputs
#popBroadcast Source
popBroadcast :: forall rw a. IxQueue (write :: WRITE | rw) a -> Effect (Maybe a)