beetle_joevandyk_extensions 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@ require "beetle_joevandyk_extensions/version"
|
|
2
2
|
require 'beetle'
|
3
3
|
|
4
4
|
module BeetleJoevandykExtensions
|
5
|
-
def
|
5
|
+
def rpc name, message, options={}
|
6
6
|
client = Beetle::Client.new
|
7
7
|
client.register_message name
|
8
8
|
status, result = client.rpc(name, message.to_json)
|
@@ -10,7 +10,7 @@ module BeetleJoevandykExtensions
|
|
10
10
|
JSON.parse(result)
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
13
|
+
def listener name, &block
|
14
14
|
client = Beetle::Client.new
|
15
15
|
client.register_queue name
|
16
16
|
client.register_handler name do |input|
|
@@ -22,4 +22,4 @@ module BeetleJoevandykExtensions
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
Beetle.
|
25
|
+
Beetle.extend(BeetleJoevandykExtensions)
|