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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c284b354b76f9161cdf34e9e85b5a4b93597aec5
4
- data.tar.gz: 676b8fbe4d05b2dd0f2eb65622892316f3d3d0ae
3
+ metadata.gz: 15ff589853b6e111150313a6f83ac1af9a9411ff
4
+ data.tar.gz: 3bb144a7034d74feb0a7bea9bccd4022bf3df466
5
5
  SHA512:
6
- metadata.gz: a972f69b934c0375c53199aceac53624a974280f89ff93358f66b683a236ccf4006e1928668cf69d998aa8e7b04aa7863126dabbdd6a4ef683b3417b42f96292
7
- data.tar.gz: 8bf09457fd619f31ab3406130df0b6e30f20052b4bc104d6b255e599e79926faac26d91cefbe0e7fb59a573e4117fd7c4ecfaac57b53de9b7c8b677b40d985af
6
+ metadata.gz: 323a8165e17c518ed8b97609e419b421890acd73816e1fbcaf8948c97f9c4e854a8d06f8ed836e654b5f5e3a45ea0aafe5a5ad59b16be71ecd1be6d8c8a9568b
7
+ data.tar.gz: b4459fae673be1dc78a5283c627417e648ea97287c732a492171915251bcd38d3677ed1ec4496d11a6dd354b9bc498d5617a28c0cc2a4a79dd1d7e1b25ed5c55
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # BackgroundProxy
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/background_proxy`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Write usage instructions here
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/[USERNAME]/background_proxy.
51
+ Bug reports and pull requests are welcome on GitHub at https://github.com/chingor13/background_proxy.
36
52
 
@@ -24,7 +24,7 @@ module BackgroundProxy
24
24
  end
25
25
  end
26
26
 
27
- def respond_to_missing?(method)
27
+ def respond_to_missing?(method, include_private = false)
28
28
  client.respond_to?(method) || super
29
29
  end
30
30
 
@@ -1,3 +1,3 @@
1
1
  module BackgroundProxy
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-09-30 00:00:00.000000000 Z
11
+ date: 2015-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler