gen_stage

Producer and consumer actors with back-pressure for Elixir

  • 所有者: elixir-lang/gen_stage
  • 平台:
  • 许可证:
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

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.

主要指标

概览
名称与所有者elixir-lang/gen_stage
主编程语言Elixir
编程语言Elixir (语言数: 1)
平台
许可证
所有者活动
创建于2015-08-26 17:57:36
推送于2025-07-15 19:19:32
最后一次提交
发布数30
最新版本名称v1.3.2 (发布于 )
第一版名称v0.4.0 (发布于 )
用户参与
星数1.6k
关注者数55
派生数196
提交数535
已启用问题?
问题数135
打开的问题数1
拉请求数162
打开的拉请求数2
关闭的拉请求数18
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?