File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
ruby/hyper-operation/lib/hyper-operation/transport Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -84,20 +84,19 @@ def self.open_channels
8484
8585 def self . add_connection ( channel_name , id = nil )
8686 channel_string = "#{ channel_name } #{ '-' +id . to_s if id } "
87+ return if open_channels . include? channel_string
8788 open_channels << channel_string
8889 channel_string
8990 end
9091
9192 def self . connect_to ( channel_name , id = nil )
9293 channel_string = add_connection ( channel_name , id )
94+ return unless channel_string # already connected!
9395 if ClientDrivers . opts [ :transport ] == :pusher
9496 channel = "#{ ClientDrivers . opts [ :channel ] } -#{ channel_string } "
9597 %x{
9698 var channel = #{ ClientDrivers . opts [ :pusher_api ] } .subscribe(#{ channel . gsub ( '::' , '==' ) } );
97- if (#{ !@pusher_dispatcher_registered } ) {
98- console.log('registering dispatch for pusher')
99- channel.bind('dispatch', #{ ClientDrivers . opts [ :dispatch ] } )
100- }
99+ channel.bind('dispatch', #{ ClientDrivers . opts [ :dispatch ] } )
101100 channel.bind('pusher:subscription_succeeded', #{ lambda { ClientDrivers . get_queued_data ( "connect-to-transport" , channel_string ) } } )
102101 }
103102 @pusher_dispatcher_registered = true
You can’t perform that action at this time.
0 commit comments