muxer 0.0.4 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +12 -0
  3. data/README.md +25 -2
  4. data/lib/muxer/version.rb +1 -1
  5. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a316a714df40c8c84c63aebee40bb00ca0e80271
4
- data.tar.gz: e0153cbbddd286cdb45755e8e77708a91b808123
3
+ metadata.gz: 92e481663f4f6adcdc844d99625cf45c3defb47e
4
+ data.tar.gz: 331679a17c1a099881adc1b0332f3f12d8c941a7
5
5
  SHA512:
6
- metadata.gz: 1f9934011fc0dd35002f7d5d8445c1ee631c52581e23009ab9909ec8528648e0058a91b7b7e5e66004de2ed377a8f91080f1fa51cea8fd70084246c270664822
7
- data.tar.gz: 1bcf43298545f85324a0a704158575a6affc283808fa19b504db9724bee72b69fae1d7528d9247fc7f273735badc96eae34a475d04ff7c8b1e512dfb61311aa8
6
+ metadata.gz: e1e79736f08a399ef007029c4910370325bd7b44b3526a1c16b96251693181122cc3876a1eb79c13112c3e77fae71b594b81ab758024c7a6e4797f02dfff4ce6
7
+ data.tar.gz: ff5f16e51bc89ebe94fdb881888f43a35c2bc1b3623a76c51a1ee0f197469555cee66dcd5e282b14b86881b482791905e0bfa5368febb1cfe2af68f6c9ca5931
data/.travis.yml ADDED
@@ -0,0 +1,12 @@
1
+ language: ruby
2
+ cache: bundler
3
+ rvm:
4
+ - 1.9.3
5
+ - 2.0.0
6
+ - 2.1.2
7
+ - 2.1.5
8
+ - 2.2.0
9
+ script: bundle exec rspec spec
10
+ addons:
11
+ code_climate:
12
+ repo_token: 6aa82237af30a07e040f64f0a184915522cdeead2da8df84b3a634bc9f189064
data/README.md CHANGED
@@ -1,6 +1,22 @@
1
1
  # Muxer
2
2
 
3
- TODO: Write a gem description
3
+ [![Quality](https://img.shields.io/codeclimate/github/ChrisMacNaughton/muxer.svg?style=flat-square)](https://codeclimate.com/github/ChrisMacNaughton/muxer)
4
+ [![Coverage](https://img.shields.io/codeclimate/coverage/github/ChrisMacNaughton/muxer.svg?style=flat-square)](https://codeclimate.com/github/ChrisMacNaughton/muxer)
5
+ [![Build](https://img.shields.io/travis-ci/ChrisMacNaughton/muxer.svg?style=flat-square)](https://travis-ci.org/ChrisMacNaughton/muxer)
6
+ [![Dependencies](https://img.shields.io/gemnasium/ChrisMacNaughton/muxer.svg?style=flat-square)](https://gemnasium.com/ChrisMacNaughton/muxer)
7
+ [![Downloads](https://img.shields.io/gem/dtv/muxer.svg?style=flat-square)](https://rubygems.org/gems/muxer)
8
+ [![Tags](https://img.shields.io/github/tag/ChrisMacNaughton/muxer.svg?style=flat-square)](https://github.com/ChrisMacNaughton/muxer/tags)[![Releases](https://img.shields.io/github/release/ChrisMacNaughton/muxer.svg?style=flat-square)](https://github.com/ChrisMacNaughton/muxer/releases)[![Issues](https://img.shields.io/github/issues/ChrisMacNaughton/muxer.svg?style=flat-square)](https://github.com/ChrisMacNaughton/muxer/issues)[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://opensource.org/licenses/MIT)[![Version](https://img.shields.io/gem/v/muxer.svg?style=flat-square)](https://rubygems.org/gems/muxer)
9
+
10
+ Muxer is a gem to allow web requests to run in parallel with seperate timeouts per request, in addition to an optional global timeout for all of the requests.
11
+
12
+ For example:
13
+
14
+ - Request 1 (Internal API) - 5 second timeout
15
+ - Request 2 (External) - 1 second timeout
16
+ - Request 3 (External) - 1 second timeout
17
+ - Request 4 (External) - 1 second timeout
18
+
19
+ Requests 2-4 will be allowed to continue waiting after their timeouts if we are still waiting on Request 1; however, if Request 1 comes back in half a second, we will finish ALL requests at the 1 second timeout. Any requests not finished within the timeouts will be added to the :failed array in the response.
4
20
 
5
21
  ## Installation
6
22
 
@@ -18,8 +34,15 @@ Or install it yourself as:
18
34
 
19
35
  ## Usage
20
36
 
21
- TODO: Write usage instructions here
37
+ ```
38
+ response = Muxer.execute do |muxer|
39
+ muxer.add_url "http://www.rubydoc.info"
40
+ muxer.add_url "https://www.google.com"
41
+ end
22
42
 
43
+ response[:failed] == []
44
+ response[:succeeded] == [Muxer::Request(url: "http://www.rubydoc.info"), Muxer::Request(url: "https://www.google.com")]
45
+ ```
23
46
  ## Contributing
24
47
 
25
48
  1. Fork it ( https://github.com/[my-github-username]/muxer/fork )
data/lib/muxer/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Muxer
2
- VERSION = '0.0.4'
2
+ VERSION = '0.1.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muxer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris MacNaughton
@@ -146,6 +146,7 @@ extra_rdoc_files: []
146
146
  files:
147
147
  - .gitignore
148
148
  - .rspec
149
+ - .travis.yml
149
150
  - Gemfile
150
151
  - LICENSE.txt
151
152
  - README.md