• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

examples/H10-Jun-2018-355283

lib/H10-Jun-2018-4,7883,762

test/H10-Jun-2018-3,2332,566

.formatter.exsH A D10-Jun-2018118 76

.gitignoreH A D10-Jun-201846 76

.travis.ymlH A D10-Jun-2018447 2221

CHANGELOG.mdH A D10-Jun-20187.2 KiB239138

README.mdH A D10-Jun-20181.8 KiB3821

mix.exsH A D10-Jun-2018865 4236

mix.lockH A D10-Jun-2018674 76

README.md

1# GenStage
2
3GenStage is a specification for exchanging events between producers and consumers.
4
5This project currently provides the following functionality:
6
7  * `GenStage` ([docs](https://hexdocs.pm/gen_stage/GenStage.html)) - a behaviour for implementing producer and consumer stages
8
9  * `ConsumerSupervisor` ([docs](https://hexdocs.pm/gen_stage/ConsumerSupervisor.html)) - a supervisor designed for consuming events from GenStage and starting a child process per event
10
11You may also be interested in [the Flow project](https://github.com/elixir-lang/flow) for building computational flows using regular `map`, `reduce` and more that run in parallel on top of GenStage. See documentation for [Flow](https://hexdocs.pm/flow) or [José Valim's keynote at ElixirConf 2016](https://youtu.be/srtMWzyqdp8?t=244) introducing the main concepts behind GenStage and Flow.
12
13## Examples
14
15Examples for using GenStage and ConsumerSupervisor can be found [examples](examples) directory:
16
17  * [ProducerConsumer](examples/producer_consumer.exs) - a simple example of setting up a pipeline of `A -> B -> C` stages and having events flowing through
18
19  * [ConsumerSupervisor](examples/consumer_supervisor.exs) - an example of how to use one or more `ConsumerSupervisor` as a consumer to a producer that works as a counter
20
21  * [GenEvent](examples/gen_event.exs) - an example of how to use `GenStage` to implement a `GenEvent` replacement that leverages concurrency and provides more flexibility regarding buffer size and back-pressure
22
23  * [RateLimiter](examples/rate_limiter.exs) - an example of performing rate limiting in a GenStage pipeline
24
25## Installation
26
27GenStage requires Elixir v1.5. Just add `:gen_stage` to your list of dependencies in mix.exs:
28
29```elixir
30def deps do
31  [{:gen_stage, "~> 0.14"}]
32end
33```
34
35## License
36
37Same as Elixir.
38