pubby 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pubby.rb +3 -1
- data/lib/pubby/pubnub.rb +2 -1
- data/lib/pubby/simple_async.rb +2 -1
- data/lib/pubby/stub.rb +1 -0
- metadata +1 -1
data/lib/pubby.rb
CHANGED
data/lib/pubby/pubnub.rb
CHANGED
@@ -10,13 +10,14 @@ class Pubby::Pubnub
|
|
10
10
|
|
11
11
|
def publish(channel_name, message)
|
12
12
|
@pubnub.publish('channel' => channel_name, 'message' => message)
|
13
|
+
true
|
13
14
|
end
|
14
15
|
|
15
16
|
def self.from_config(config)
|
16
17
|
new(
|
17
18
|
Pubnub.new(
|
18
19
|
config.fetch('publish_key') { raise "publish_key is required" },
|
19
|
-
config.fetch('subscribe_key'
|
20
|
+
config.fetch('subscribe_key') { raise "subscribe_key is required" },
|
20
21
|
config.fetch('secret_key', ''),
|
21
22
|
config.fetch('ssl_on', false)
|
22
23
|
)
|
data/lib/pubby/simple_async.rb
CHANGED
@@ -17,6 +17,7 @@ class Pubby::SimpleAsync
|
|
17
17
|
|
18
18
|
def publish(channel, message)
|
19
19
|
@queue << [channel, message]
|
20
|
+
true
|
20
21
|
end
|
21
22
|
|
22
23
|
def shutdown!
|
@@ -36,7 +37,7 @@ class Pubby::SimpleAsync
|
|
36
37
|
def start_threads!
|
37
38
|
@thread_count.times do
|
38
39
|
@threads << Thread.new do
|
39
|
-
Thread.abort_on_exception =
|
40
|
+
Thread.abort_on_exception = false
|
40
41
|
process_messages!
|
41
42
|
end
|
42
43
|
end
|
data/lib/pubby/stub.rb
CHANGED