datapipes Gem Version

datapipes is an asynchronous multi streaming library.

Build Status Coverage Status Code Climate Dependency Status Inline docs

About

datapipes encourages to handle multi streamings asynchronously. datapipes has a few objects sparated by its responsibility.

  • Source Produces resources and emits the resource to pipe.
  • Tube Effector for resources. Processes resource in the middle of pipe.
  • Sink Consumer for resources. Do something with processed resources.
  • Pipe Resources pass through the pipe. Handles resources asynchronously.
 Source
   |   ↓ data flow
   |
  Tube
   |    pipe is '|'
   |
  Sink

To handle multi streamings, datapipes offers composability. Source, Tube and Sink are composable individually. So the diagram above will be:

 Composed Source works concurrently.

  [Source Source Source]
            |
            |  pipe handles asynchronous.
            |
           Tube
           Tube  Composed Tube has individual tube in series.
           Tube
           Tube
            |
            |
            |
     [Sink Sink Sink]

 Composed Sink works concurrently.

You can see how to compose objects in examples/composing.rb.

Installation

datapipes requires Ruby >= 2.0.

Add this line to your application's Gemfile:

gem 'datapipes'

And then execute:

$ bundle

Or install it yourself as:

$ gem install datapipes

Usage

You have to define your own Source, Tube and Sink. See more in examples.

Composing objects

See more in examples/composing.rb.

Contributing

  1. Fork it ( http://github.com/taiki45/datapipes/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request