Code Monkey home page Code Monkey logo

pipes's Introduction

Pipes

Pipes is an application for creating pipelines of pooled AMQP consumers and publishers.

Online documentation

Note: only available if you are logged in the VPN

You can read the online documentation here.

You can also generate your own local copy:

$ MIX_ENV=docs mix docs

Usage

In order to implement consumers the following example shows how to implement them.

# In config/config.exs
config :my_app, MyApp.Consumer,
  %{name: "my_app_pipeline",
    amqp: %{exchange: "a_exchange", queue: "queue_a",
            uri: "amqp://guest:guest@localhost"}}

# In your supervisor
defmodule MyApp.Supervisor do
  use Supervisor

  def init(_args) do
    children = [worker(MyApp.Consumer, [])]
    supervise(children, [strategy: :one_for_one])
  end
end

# In your consumer module
defmodule MyApp.Consumer do
  use Pipes.Consumer, otp_app: :my_app

  def consume(payload) do
    do_something(payload)
  end
end

To define producers the requirements are a bit similar to consumers definitions.

# In config/config.exs
config :my_app, MyApp.Producer,
  %{name: "my_app_pipeline",
    amqp: %{exchange: "a_exchange"
            uri: "amqp://guest:guest@localhost"}}

# In your supervisor
defmodule MyApp.Supervisor do
  use Supervisor

  def init(_args) do
    children = [worker(MyApp.Producer, [])]
    supervise(children, [strategy: :one_for_one])
  end
end

# In your consumer module
defmodule MyApp.Producer do
  use Pipes.Producer, otp_app: :my_app
end

# From the module you are interested to publish, a function is available to be called.
MyApp.Producer.publish("my_payload")

Contributing

Please take your time to read throught our CONTRIBUTING.md guide for understanding the development flow and guidelines.

Issues and discussions

Consider taking a look at the issue tracker if you want to start helping out.

All documentation non strictly related to source code is found in the wiki. Although not explicitly stated in the CONTRIBUTING.md guidelines, the same principles apply to the wiki.

License

Copyright (c) 2015-2017 Tappsi S.A.S

This work is free. You can redeistribute it and/or modify it under the terms of the MIT License. See the LICENSE file for more details.

pipes's People

Contributors

arpunk avatar gremly avatar oamado avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

gremly arpunk

pipes's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.