cable_room 0.6.2.beta7 → 0.6.2.beta9
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/cable_room/room/port_management.rb +1 -4
- data/lib/cable_room/room_member.rb +18 -3
- data/lib/cable_room/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5a0b89cf59e8dc6fa9ebfed2efe728c0c2916bbac6d54738612944adec072762
|
|
4
|
+
data.tar.gz: 55db8ebfde7f3574755f8348e90a4986c8943600c9231b1ce0af723f94863f33
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 60f838c24cc7b4bc43541c0cc9386f6a295824b0a44526a1fa0d018240966dc6c81665faed13edc76a7ae7fa4d0ab958dbe0c2486b85fc81f502e3fc819dafe2
|
|
7
|
+
data.tar.gz: 61c0ea11ca13892247ac210fe32cc2c1d5ee157f1da7125f4a9fdde22bee7e9d70a6468e539a7e4503814feefbcbdd80b2e2075291b4b48fd9cd8183e89d6415
|
|
@@ -118,10 +118,7 @@ module CableRoom
|
|
|
118
118
|
def handle_received_message(message)
|
|
119
119
|
case message['type']
|
|
120
120
|
when 'port_connected'
|
|
121
|
-
mo = @_port_clients[@current_message_origin]
|
|
122
|
-
return if mo
|
|
123
|
-
|
|
124
|
-
mo = @_port_clients[@current_message_origin] = PortClient.new(self, @current_message_origin)
|
|
121
|
+
mo = @_port_clients[@current_message_origin] ||= PortClient.new(self, @current_message_origin)
|
|
125
122
|
|
|
126
123
|
mo.touch_activity!
|
|
127
124
|
mo.tag!(message['tags'])
|
|
@@ -51,7 +51,11 @@ module CableRoom
|
|
|
51
51
|
|
|
52
52
|
def transmit_subscription_confirmation(...)
|
|
53
53
|
super
|
|
54
|
-
_room_memberships.
|
|
54
|
+
memberships = _room_memberships.to_a
|
|
55
|
+
memberships.each(&:streams_live!)
|
|
56
|
+
connection.worker_pool.async_exec(self, connection: connection) do
|
|
57
|
+
memberships.each(&:transmit_port_connected)
|
|
58
|
+
end
|
|
55
59
|
end
|
|
56
60
|
end
|
|
57
61
|
|
|
@@ -78,6 +82,7 @@ module CableRoom
|
|
|
78
82
|
|
|
79
83
|
@has_left = false
|
|
80
84
|
@has_established = false
|
|
85
|
+
@streams_live = false
|
|
81
86
|
|
|
82
87
|
@cable_channel = cable_channel
|
|
83
88
|
@room_class = room_class
|
|
@@ -146,6 +151,11 @@ module CableRoom
|
|
|
146
151
|
|
|
147
152
|
def key; @room_key; end
|
|
148
153
|
|
|
154
|
+
# @internal
|
|
155
|
+
def streams_live!
|
|
156
|
+
@streams_live = true
|
|
157
|
+
end
|
|
158
|
+
|
|
149
159
|
# @internal
|
|
150
160
|
def transmit_port_connected
|
|
151
161
|
msg = {
|
|
@@ -196,7 +206,10 @@ module CableRoom
|
|
|
196
206
|
@has_established = true
|
|
197
207
|
@on_joined&.call(self) if first_acknowledgement
|
|
198
208
|
when 'room_opened'
|
|
199
|
-
|
|
209
|
+
# Only safe once our own streams are confirmed; otherwise the room may acknowledge on the
|
|
210
|
+
# private port before anyone is listening. If we are not live yet, the subscription
|
|
211
|
+
# confirmation hook will announce for us.
|
|
212
|
+
transmit_port_connected if @streams_live
|
|
200
213
|
@on_room_opened&.call(self)
|
|
201
214
|
when 'room_closed'
|
|
202
215
|
leave!
|
|
@@ -243,7 +256,9 @@ module CableRoom
|
|
|
243
256
|
|
|
244
257
|
@preconfigure&.call(self)
|
|
245
258
|
|
|
246
|
-
#
|
|
259
|
+
# Announcing here races the async stream subscriptions: the room can acknowledge on the
|
|
260
|
+
# private port before it is live and the ack is lost. transmit_subscription_confirmation
|
|
261
|
+
# announces instead, once every stream is confirmed.
|
|
247
262
|
|
|
248
263
|
maybe_provision_room
|
|
249
264
|
end
|
data/lib/cable_room/version.rb
CHANGED