class Faye::EventSource::Stream
def each(&callback)
def each(&callback) @stream_send ||= callback end
def fail
def fail @event_source.close end
def initialize(event_source)
def initialize(event_source) @event_source = event_source @connection = event_source.env['em.connection'] @stream_send = event_source.env['stream.send'] @connection.socket_stream = self if @connection.respond_to?(:socket_stream) end
def receive(data)
def receive(data) end
def write(data)
def write(data) return unless @stream_send @stream_send.call(data) rescue nil end