muxer 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +12 -0
- data/README.md +25 -2
- data/lib/muxer/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92e481663f4f6adcdc844d99625cf45c3defb47e
|
4
|
+
data.tar.gz: 331679a17c1a099881adc1b0332f3f12d8c941a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1e79736f08a399ef007029c4910370325bd7b44b3526a1c16b96251693181122cc3876a1eb79c13112c3e77fae71b594b81ab758024c7a6e4797f02dfff4ce6
|
7
|
+
data.tar.gz: ff5f16e51bc89ebe94fdb881888f43a35c2bc1b3623a76c51a1ee0f197469555cee66dcd5e282b14b86881b482791905e0bfa5368febb1cfe2af68f6c9ca5931
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,6 +1,22 @@
|
|
1
1
|
# Muxer
|
2
2
|
|
3
|
-
|
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
|
-
|
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
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
|
+
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
|