tmapchan-0.0.1: A time-ordered multimap which consumes values as you lookup

Safe HaskellSafe
LanguageHaskell2010

Control.Concurrent.STM.TMapChan.Hash

Contents

Synopsis

Documentation

newtype TMapChan k a Source #

Constructors

TMapChan 

Fields

insert :: (Eq k, Hashable k) => TMapChan k a -> k -> a -> STM () Source #

insertMany :: (Eq k, Hashable k) => TMapChan k a -> k -> [a] -> STM () Source #

insertFirst :: (Eq k, Hashable k) => TMapChan k a -> k -> a -> STM () Source #

Inserts the element to the head of the stack, to be viewed next

lookup :: (Eq k, Hashable k) => TMapChan k a -> k -> STM a Source #

Blocks until there's a value available to remove from the mutlimap

tryLookup :: (Eq k, Hashable k) => TMapChan k a -> k -> STM (Maybe a) Source #

lookupAll :: (Eq k, Hashable k) => TMapChan k a -> k -> STM [a] Source #

observe :: (Eq k, Hashable k) => TMapChan k a -> k -> STM a Source #

Blocks until there's a vale available to view, without removing it

tryObserve :: (Eq k, Hashable k) => TMapChan k a -> k -> STM (Maybe a) Source #

observeAll :: (Eq k, Hashable k) => TMapChan k a -> k -> STM [a] Source #

delete :: (Eq k, Hashable k) => TMapChan k a -> k -> STM () Source #

Deletes the next element in the map, if it exists. Doesn't block.

deleteAll :: (Eq k, Hashable k) => TMapChan k a -> k -> STM () Source #

Clears the queue at the key

Utils

getTChan :: (Eq k, Hashable k) => TMapChan k a -> k -> STM (TChan a) Source #

Creates a new one if it doesn't already exist

broadcast :: (Eq k, Hashable k) => TMapChan k a -> a -> STM () Source #

cloneAt Source #

Arguments

:: (Eq k, Hashable k) 
=> TMapChan k a 
-> k

key to clone from

-> k

key to clone to

-> STM () 

cloneAll :: (Eq k, Hashable k) => TMapChan k a -> k -> STM () Source #

Clones all the content for every key, by the key.

cloneAllUniquely :: (Eq k, Hashable k, Eq a, Hashable a) => TMapChan k a -> k -> STM () Source #

Clones all the content from every channel, and inserts the unique subset of them to k, in an unspecified order.