agis 0.2.8 → 0.2.9

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 (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/agis.rb +20 -12
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a3007830c900d69b3a8729fac5816644820e9ac
4
- data.tar.gz: 9bba42fe778b4362540c6792d54b0e8f788f0fa4
3
+ metadata.gz: 20af34669ab28f91465c183b98dfb44695466186
4
+ data.tar.gz: 11d27c5d2e30a220e2b76ec352a51b2573bf3712
5
5
  SHA512:
6
- metadata.gz: b44f8bc9278c767fbdc9e83c4d29d30a6ad15dba40fa03684f51b01c0db9486b173cf36e1cb188b139c4b8e0a8985fe860da19cb957b6bb8d27c2843f984cd93
7
- data.tar.gz: 5ab8555f66a9a617d96dd8bef79264351e4fb32a4099aad06c0ab3b7ceaedf3a057f286bf23922c673a28a64da1928c0b27aa3c1cf2e31ed674c65ec382c006e
6
+ metadata.gz: f444b12163fec19bf60e80859b5314243387bae5452d3f3e902010dea34f34123fa201736f66a12080817839ffbda905c7f61ae80d2b9e2f9bf56ee7672613b8
7
+ data.tar.gz: 25a757423d3994021a6539c91a962a54f18d24924848ebae32ebe197cce72d99ebaf55f79598c6ef61dadb605701e598c990245e2c545e863773724c7ed8c1cf
@@ -154,16 +154,23 @@ module Agis
154
154
  return nil
155
155
  end
156
156
  mn = mni[2..-1]
157
- mc = @agis_methods[mn.to_sym][:arity]
158
- meti = @agis_methods[mn.to_sym][:method]
159
- mrm = @agis_methods[mn.to_sym][:mode]
160
- case meti
161
- when Proc
162
- met = meti
163
- when Symbol
164
- met = self.method(meti)
165
- when NilClass
166
- met = self.method(mn.to_sym) # when proc is Nil, call the class methods all the same
157
+ mns = mn.to_sym
158
+ if mn == "AGIS_NOOP" # NOOP
159
+ redis.hset self.agis_returnbox, lusig, "done"
160
+ popfive(redis)
161
+ return :next
162
+ else
163
+ mc = @agis_methods[mns][:arity]
164
+ mrm = @agis_methods[mns][:mode]
165
+ meti = @agis_methods[mns][:method]
166
+ case meti
167
+ when Proc
168
+ met = meti
169
+ when Symbol
170
+ met = self.method(meti)
171
+ when NilClass
172
+ met = self.method(mn.to_sym) # when proc is Nil, call the class methods all the same
173
+ end
167
174
  end
168
175
 
169
176
  begin
@@ -237,7 +244,8 @@ module Agis
237
244
 
238
245
  # Push a call and ncrunch immediately
239
246
  # this returns the last return value from the queue
240
- def agis_call(redis, name, arg1=nil, arg2=nil, arg3=nil)
247
+ def agis_call(redis, name=nil, arg1=nil, arg2=nil, arg3=nil)
248
+ name ||= "AGIS_NOOP"
241
249
  until_sig = Time.now.to_s + ":" + Process.pid.to_s + Random.new.rand(4000000000).to_s + Random.new.rand(4000000000).to_s
242
250
  loop do
243
251
  begin
@@ -255,7 +263,7 @@ module Agis
255
263
  end
256
264
 
257
265
  # Alias for agis_call
258
- def acall(redis, name, arg1=nil, arg2=nil, arg3=nil)
266
+ def acall(redis, name=nil, arg1=nil, arg2=nil, arg3=nil)
259
267
  agis_call(redis, name, arg1, arg2, arg3)
260
268
  end
261
269
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gert Oja
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-08 00:00:00.000000000 Z
11
+ date: 2015-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis