rservicebus 0.0.5 → 0.0.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.
- data/lib/rservicebus/Agent.rb +9 -0
- data/lib/rservicebus/Test/Bus.rb +16 -1
- data/lib/rservicebus/Test/Redis.rb +10 -1
- metadata +2 -2
data/lib/rservicebus/Agent.rb
CHANGED
@@ -16,6 +16,15 @@ class Agent
|
|
16
16
|
@beanstalk.put( serialized_object )
|
17
17
|
end
|
18
18
|
|
19
|
+
def checkForReply( queueName )
|
20
|
+
@beanstalk.watch queueName
|
21
|
+
job = @beanstalk.reserve
|
22
|
+
body = job.body
|
23
|
+
job.delete
|
24
|
+
|
25
|
+
@msg = YAML::load(body)
|
26
|
+
return @msg.msg
|
27
|
+
end
|
19
28
|
end
|
20
29
|
|
21
30
|
end
|
data/lib/rservicebus/Test/Bus.rb
CHANGED
@@ -1,13 +1,17 @@
|
|
1
1
|
module RServiceBus
|
2
2
|
|
3
3
|
class Test_Bus
|
4
|
-
attr_accessor :publishList, :sendList
|
4
|
+
attr_accessor :publishList, :sendList, :replyList, :logList
|
5
5
|
@publishList
|
6
6
|
@sendList
|
7
|
+
@replyList
|
8
|
+
@logList
|
7
9
|
|
8
10
|
def initialize
|
9
11
|
@publishList = Array.new
|
10
12
|
@sendList = Array.new
|
13
|
+
@replyList = Array.new
|
14
|
+
@logList = Array.new
|
11
15
|
end
|
12
16
|
|
13
17
|
def Publish( msg )
|
@@ -17,6 +21,17 @@ class Test_Bus
|
|
17
21
|
def Send( msg )
|
18
22
|
@sendList << msg
|
19
23
|
end
|
24
|
+
|
25
|
+
def Reply( msg )
|
26
|
+
@replyList << msg
|
27
|
+
end
|
28
|
+
|
29
|
+
def log( string, verbose=false )
|
30
|
+
item = Hash.new
|
31
|
+
item["string"] = string
|
32
|
+
item["verbose"] = verbose
|
33
|
+
@logList << item
|
34
|
+
end
|
20
35
|
end
|
21
36
|
|
22
37
|
end
|
@@ -2,7 +2,7 @@ module RServiceBus
|
|
2
2
|
|
3
3
|
class Test_Redis
|
4
4
|
|
5
|
-
@keyHash
|
5
|
+
@keyHash
|
6
6
|
|
7
7
|
def initialize
|
8
8
|
@keyHash = Hash.new
|
@@ -26,6 +26,15 @@ class Test_Redis
|
|
26
26
|
def smembers( key )
|
27
27
|
return @keyHash[key]
|
28
28
|
end
|
29
|
+
|
30
|
+
def incr( key )
|
31
|
+
if !@keyHash.has_key?( key ) then
|
32
|
+
@keyHash[key] = 0
|
33
|
+
end
|
34
|
+
|
35
|
+
@keyHash[key] = @keyHash[key] + 1
|
36
|
+
return @keyHash[key]
|
37
|
+
end
|
29
38
|
end
|
30
39
|
|
31
40
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rservicebus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-19 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A ruby implementation of NServiceBus
|
15
15
|
email: guy@guyirvine.com
|