gen_stage

Producer and consumer actors with back-pressure for Elixir

  • Owner: elixir-lang/gen_stage
  • Platform:
  • License::
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

GenStage

GenStage is a specification for exchanging events between producers and consumers.

This project currently provides the following functionality:

  • GenStage (docs) - a behaviour for implementing producer and consumer stages

  • ConsumerSupervisor (docs) - a supervisor designed for consuming events from GenStage and starting a child process per event

You may also be interested in two other projects built on top of GenStage:

Examples

Examples for using GenStage and ConsumerSupervisor can be found in the examples directory:

  • ProducerConsumer - a simple example of setting up a pipeline of A -> B -> C stages and having events flowing through it

  • ConsumerSupervisor - an example of how to use one or more ConsumerSupervisor as a consumer to a producer that works as a counter

  • GenEvent - an example of how to use GenStage to implement an alternative to GenEvent that leverages concurrency and provides more flexibility regarding buffer size and back-pressure

  • RateLimiter - an example of performing rate limiting in a GenStage pipeline

Installation

GenStage requires Elixir v1.5. Just add :gen_stage to your list of dependencies in mix.exs:

def deps do
  [{:gen_stage, "~> 1.0"}]
end

License

Same as Elixir.

Main metrics

Overview
Name With Ownerelixir-lang/gen_stage
Primary LanguageElixir
Program languageElixir (Language Count: 1)
Platform
License:
所有者活动
Created At2015-08-26 17:57:36
Pushed At2025-02-09 09:56:19
Last Commit At
Release Count27
Last Release Namev1.2.1 (Posted on )
First Release Namev0.4.0 (Posted on )
用户参与
Stargazers Count1.5k
Watchers Count56
Fork Count195
Commits Count527
Has Issues Enabled
Issues Count132
Issue Open Count1
Pull Requests Count158
Pull Requests Open Count3
Pull Requests Close Count17
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private