perform-later 1.0.0.alpha.5 → 1.0.0.alpha.6
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.
- checksums.yaml +4 -4
- data/lib/perform_later/aliasing.rb +10 -4
- data/lib/perform_later/delegation.rb +3 -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: 01650959394c9104dcf5177ba9d445408731a78c
|
4
|
+
data.tar.gz: cfcbfbe3e8870d8e4df0c874abd3305952fb3c6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b54ecd5be7f6b9431b53c00cfe4f200bc54d50e513655a978b00dfe8f092aa1451b7e8152ea75475290eee334aa1d40e0e75ada1d9c8282b198da2129e970a0a
|
7
|
+
data.tar.gz: f6f729837467501ab300e18aeabb5c0d7c43974abc119f013ffcdce224e05bc0a7e0993b3b8c6dab0042dd5fd08a093a1f779e76cbf9f1d73556eb75440ab57e
|
@@ -37,13 +37,19 @@ module PerformLater
|
|
37
37
|
# end
|
38
38
|
# end
|
39
39
|
def perform_later(method, opts={})
|
40
|
-
|
40
|
+
config = opts.clone
|
41
|
+
aliases = Array(config.delete(:as){ ["#{method}_later", "#{method}_async"] })
|
42
|
+
self.perform_later_configs[method.to_s] = config
|
41
43
|
|
42
|
-
|
43
|
-
|
44
|
+
entry_point = aliases.delete_at(0)
|
45
|
+
define_singleton_method entry_point, ->(*args) do
|
46
|
+
args = call_before_serialize(config[:before_serialize], args)
|
44
47
|
perform_async(method, *args)
|
45
48
|
end
|
46
|
-
|
49
|
+
|
50
|
+
aliases.each do | entry_point_alias |
|
51
|
+
singleton_class.send(:alias_method, entry_point_alias, entry_point)
|
52
|
+
end
|
47
53
|
end
|
48
54
|
|
49
55
|
private
|
@@ -1,6 +1,8 @@
|
|
1
1
|
module PerformLater
|
2
2
|
module Delegation
|
3
|
-
|
3
|
+
# receive the call from the asyncronous client
|
4
|
+
# with the method we have setup to call
|
5
|
+
# and the args to be passed to the deserialization hook
|
4
6
|
def perform(method, *args)
|
5
7
|
config = perform_later_configs[method] || {}
|
6
8
|
call_after_deserialize(config[:after_deserialize], *args)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: perform-later
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.alpha.
|
4
|
+
version: 1.0.0.alpha.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Prothro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|