background_proxy 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -5
- data/lib/background_proxy/proxy.rb +1 -1
- data/lib/background_proxy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15ff589853b6e111150313a6f83ac1af9a9411ff
|
4
|
+
data.tar.gz: 3bb144a7034d74feb0a7bea9bccd4022bf3df466
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 323a8165e17c518ed8b97609e419b421890acd73816e1fbcaf8948c97f9c4e854a8d06f8ed836e654b5f5e3a45ea0aafe5a5ad59b16be71ecd1be6d8c8a9568b
|
7
|
+
data.tar.gz: b4459fae673be1dc78a5283c627417e648ea97287c732a492171915251bcd38d3677ed1ec4496d11a6dd354b9bc498d5617a28c0cc2a4a79dd1d7e1b25ed5c55
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# BackgroundProxy
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
This gem provides a proxy interface to background method calls to a background thread. A good case is for an external api request that can be deferred until later (rather than blocking the rest of the request).
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,7 +20,25 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
Instead of using your client instance, wrap that client instance in a background proxy. It will create new Thread(s) to handle writing to the client.
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
# example usage for writing messages to Kafka via the Poseidon gem
|
27
|
+
client = Poseidon::Producer.new(...)
|
28
|
+
proxy = BackgroundProxy::Proxy.new(client)
|
29
|
+
proxy.send_messages([...])
|
30
|
+
```
|
31
|
+
|
32
|
+
Any message that the wrapped object can handle, the proxy will send through to that model.
|
33
|
+
|
34
|
+
**IMPORTANT NOTES**
|
35
|
+
* These proxies do not currently clean themselves up until after the request finishes.
|
36
|
+
* The clients need to be thread-safe or not have any kind of mutable state (that is mutated).
|
37
|
+
|
38
|
+
## Changelog
|
39
|
+
|
40
|
+
v0.1.1 - Fix respond_to_missing? (respond_to? won't crash)
|
41
|
+
v0.1.0 - Initial release
|
26
42
|
|
27
43
|
## Development
|
28
44
|
|
@@ -32,5 +48,5 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
48
|
|
33
49
|
## Contributing
|
34
50
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
51
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/chingor13/background_proxy.
|
36
52
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: background_proxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Ching
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|