celluloid_pubsub 0.8.2 → 0.8.3
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/celluloid_pubsub/reactor.rb +0 -1
- data/lib/celluloid_pubsub/version.rb +1 -1
- data/lib/celluloid_pubsub/web_server.rb +6 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cef2fe4fd546a1212a5155623ec3ae3fb94f7fa1
|
4
|
+
data.tar.gz: 170c7644d4e795255cf1baeb460b7c5697a54bc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3a45b9c74e47978ccd990e36ce1bab76d20bf5ed893a767f80fba66ee7c49013d8163c64d5c08c463714defd3ccf83aa2c47f837ec21d80a86b9fd25d5fd2c1
|
7
|
+
data.tar.gz: 3465a0d8a0cd7893f8540de46a9642b933cf0eaa750296959e1c27ff50e3927c41746e483fc51d5d98b61574dd084cf120c980196c726f7b8508c5c40d13f0ce
|
@@ -312,7 +312,6 @@ module CelluloidPubsub
|
|
312
312
|
# @api public
|
313
313
|
def publish_event(current_topic, message)
|
314
314
|
return if current_topic.blank? || message.blank?
|
315
|
-
log_debug "#{self.class} tries to publish to #{current_topic} with #{message} into subscribers #{@server.subscribers[current_topic].inspect}"
|
316
315
|
@server.mutex.synchronize do
|
317
316
|
(@server.subscribers[current_topic].dup || []).pmap do |hash|
|
318
317
|
hash[:reactor].websocket << message
|
@@ -231,13 +231,13 @@ module CelluloidPubsub
|
|
231
231
|
#
|
232
232
|
# @api public
|
233
233
|
def route_websocket(reactor, socket)
|
234
|
-
|
235
|
-
|
234
|
+
url = socket.url
|
235
|
+
if url == path || url == "/?"
|
236
236
|
reactor.async.work(socket, Actor.current)
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
237
|
+
else
|
238
|
+
log_debug "Received invalid WebSocket request for: #{url}"
|
239
|
+
socket.close
|
240
|
+
end
|
241
241
|
end
|
242
242
|
|
243
243
|
# If the message can be parsed into a Hash it will respond to the reactor's websocket connection with the same message in JSON format
|