Module

IxQueue

Package
purescript-queue
Repository
athanclark/purescript-queue

#IxQueue Source

newtype IxQueue (rw :: Row SCOPE) a

Constructors

Instances

#new Source

new :: forall a. Effect (IxQueue (read :: READ, write :: WRITE) a)

#put Source

put :: forall rw a. IxQueue (write :: WRITE | rw) a -> String -> a -> Effect Unit

#putMany Source

putMany :: forall rw t a. Traversable t => IxQueue (write :: WRITE | rw) a -> String -> NonEmpty t a -> Effect Unit

Application policy is such that the inputs are stored in the named handler's "pending" values, if a handler isn't registered.

#broadcast Source

broadcast :: forall rw a. IxQueue (write :: WRITE | rw) a -> a -> Effect Unit

#broadcastMany Source

broadcastMany :: forall rw t a. Traversable t => IxQueue (write :: WRITE | rw) a -> NonEmpty t a -> Effect Unit

#broadcastExcept Source

broadcastExcept :: forall rw a. IxQueue (write :: WRITE | rw) a -> Array String -> a -> Effect Unit

#broadcastManyExcept Source

broadcastManyExcept :: forall rw t a. Traversable t => IxQueue (write :: WRITE | rw) a -> Array String -> NonEmpty t a -> Effect Unit

Application policy is such that the inputs will be applied uniformly to all handlers, sorted by their keyed ordering, per input - directed by t's Traversable instance.

#on Source

on :: forall rw a. IxQueue (read :: READ | rw) a -> String -> Handler a -> Effect Unit

Application policy is such that the globally pending inputs will be extracted and applied to the handler, if they exist, and likewise to the locally pending inputs,

#once Source

once :: forall rw a. IxQueue (read :: READ | rw) a -> String -> Handler a -> Effect Unit

#draw Source

draw :: forall a rw. IxQueue (read :: READ | rw) a -> String -> Aff a

#readBroadcast Source

readBroadcast :: forall rw a. IxQueue rw a -> Effect (Array a)

#read Source

read :: forall rw a. IxQueue rw a -> String -> Effect (Array a)

#takeBroadcast Source

takeBroadcast :: forall rw a. IxQueue (write :: WRITE | rw) a -> Effect (Array a)

Removes only the globally pending inputs

#take Source

take :: forall rw a. IxQueue (write :: WRITE | rw) a -> String -> Effect (Array a)

Removes locally pending inputs for a specific key

#del Source

del :: forall rw a. IxQueue (read :: READ | rw) a -> String -> Effect Boolean

Unregisters a handler, returns whether one existed

#clear Source

clear :: forall rw a. IxQueue (read :: READ | rw) a -> Effect Unit

Removes all handlers, but preserves pending data

#drain Source

drain :: forall rw a. IxQueue (read :: READ | rw) a -> String -> Effect Unit

Applies a nullary named handler, to remove any globally pending data

Re-exports from Queue.Types

#WRITE Source

data WRITE :: SCOPE

#READ Source

data READ :: SCOPE

#Handler Source

type Handler a = a -> Effect Unit

#QueueScope Source

class QueueScope (q :: Row SCOPE -> Type -> Type) 

#SCOPE Source

data SCOPE :: Type