tmapchan-0.0.3: An insert-ordered multimap (indexed FIFO) which consumes values as you lookup

Control.Concurrent.STM.TMapChan.Hash

Contents

Synopsis

# Documentation

newtype TMapChan k a Source

Constructors

 TMapChan FieldsrunTMapChan :: TVar (HashMap k (TChan a))

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

keys :: TMapChan k a -> STM [k] Source

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

Creates a new one if it doesn't already exist

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

broadcast :: (Eq k, Hashable k) => TMapChan k a -> a -> STM () 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.
{"ft_lang_label":"__label__en","ft_lang_prob":0.71609014,"math_prob":0.8687178,"size":2367,"snap":"2019-51-2020-05","text_gpt3_token_len":807,"char_repetition_ratio":0.31570038,"word_repetition_ratio":0.56497175,"special_character_ratio":0.39459231,"punctuation_ratio":0.1920668,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98851854,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-01-19T22:30:04Z\",\"WARC-Record-ID\":\"<urn:uuid:53ae5ecf-f9fa-4b3f-865b-d504a5fba5d4>\",\"Content-Length\":\"18066\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:05bd6df9-f2ad-4b63-ba7f-2740b6637b79>\",\"WARC-Concurrent-To\":\"<urn:uuid:ae46d727-cf66-4be7-bc4f-b2f8ba6e7365>\",\"WARC-IP-Address\":\"151.101.248.68\",\"WARC-Target-URI\":\"https://hackage.haskell.org/package/tmapchan-0.0.3/docs/Control-Concurrent-STM-TMapChan-Hash.html\",\"WARC-Payload-Digest\":\"sha1:OPNRF52JWRNKEOGZFYQ7WAPXZSE6FV57\",\"WARC-Block-Digest\":\"sha1:JDSMN4EVVNW2WU7JVC67B4M4D7U6XCHL\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-05/CC-MAIN-2020-05_segments_1579250595282.35_warc_CC-MAIN-20200119205448-20200119233448-00088.warc.gz\"}"}