# File lib/faye/transport/transport.rb, line 24 def batching? true end
# File lib/faye/transport/transport.rb, line 28 def close end
# File lib/faye/transport/transport.rb, line 35 def connection_type self.class.connection_type end
# File lib/faye/transport/transport.rb, line 31 def encode(messages) '' end
# File lib/faye/transport/transport.rb, line 39 def send_message(message) debug('Client ? sending message to ? via ?: ?', @dispatcher.client_id, @endpoint, connection_type, message) unless batching? promise = EventMachine::DefaultDeferrable.new promise.succeed(request([message])) return promise end @outbox << message flush_large_batch if message['channel'] == Channel::HANDSHAKE return publish(0.01) end if message['channel'] == Channel::CONNECT @connection_message = message end publish(Engine::MAX_DELAY) end
# File lib/faye/transport/transport.rb, line 12 def initialize(dispatcher, endpoint) super() @dispatcher = dispatcher @endpoint = endpoint @outbox = [] @proxy = @dispatcher.proxy.dup @proxy[:origin] ||= @endpoint.respond_to?(:find_proxy) ? @endpoint.find_proxy : nil end