blocking_queue alternatives and similar packages
Based on the "Algorithms and Data structures" category.
Alternatively, view blocking_queue alternatives based on common mentions on social networks and blogs.
-
exconstructor
An Elixir library for generating struct constructors that handle external data with ease. -
aja
Extension of the Elixir standard library focused on data stuctures, data manipulation and performance -
remodel
:necktie: An Elixir presenter package used to transform map structures. "ActiveModel::Serializer for Elixir" -
MapDiff
Calculates the difference between two (nested) maps, and returns a map representing the patch of changes. -
the_fuzz
String metrics and phonetic algorithms for Elixir (e.g. Dice/Sorensen, Hamming, Jaccard, Jaro, Jaro-Winkler, Levenshtein, Metaphone, N-Gram, NYSIIS, Overlap, Ratcliff/Obershelp, Refined NYSIIS, Refined Soundex, Soundex, Weighted Levenshtein) -
exmatrix
Elixir library implementing a parallel matrix multiplication algorithm and other utilities for working with matrices. Used for benchmarking computationally intensive concurrent code. -
bitmap
Bitmap implementation in Elixir using binaries and integers. Fast space efficient data structure for lookups -
Closure Table
Closure Table for Elixir - a simple solution for storing and manipulating complex hierarchies.
InfluxDB - Purpose built for real-time analytics at any scale.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of blocking_queue or a related project?
README
BlockingQueue
BlockingQueue is a simple queue implemented as a GenServer. It has a fixed maximum length established when it is created.
The queue is designed to decouple, but limit, the latency between a producer and
consumer. When pushing to a full queue the push
operation blocks
preventing the producer from making progress until the consumer catches up.
Likewise, when calling pop
on an empty queue the call blocks until there
is work to do.
Installation
Add a dependency in your mix.exs:
deps: [{:blocking_queue, "~> 1.0"}]
Examples
A simple example:
{:ok, pid} = BlockingQueue.start_link(5)
BlockingQueue.push(pid, "Hi")
BlockingQueue.pop(pid) # should return "Hi"
The queue is designed to be used from more complex examples in which the producer and consumer are in separate processes and run asynchronously to each other.
An example of an infinite stream:
{:ok, pid} = BlockingQueue.start_link(:infinity)
BlockingQueue.push(pid, "Hi")
BlockingQueue.pop(pid) # should return "Hi"
An example using the Stream
API
{:ok, pid} = BlockingQueue.start_link(5)
[1, 2, 3]
|> BlockingQueue.push_stream(pid)
BlockingQueue.pop_stream(pid)
|> Enum.take(3) # Should return [1, 2, 3]
Contribute
Just fork the repo, make your change, and send me a pull request.
Or, feel free to file and issue and start a discussion about a new feature you have in mind.