Class: GripPubControl

Inherits:
PubControl
  • Object
show all
Defined in:
lib/grippubcontrol.rb

Instance Method Summary collapse

Instance Method Details

#publish_http_response(channel, http_response, id = nil, prev_id = nil) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/grippubcontrol.rb', line 14

def publish_http_response(channel, http_response, id=nil, prev_id=nil)
  if http_response.is_a?(String)
    http_response = HttpResponseFormat.new(nil, nil, nil, http_response)
  end
  item = Item.new(http_response, id, prev_id)
  super_publish(channel, item)
end

#publish_http_response_async(channel, http_response, id = nil, prev_id = nil, callback = nil) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/grippubcontrol.rb', line 22

def publish_http_response_async(channel, http_response, id=nil,
    prev_id=nil, callback=nil)
  if http_response.is_a?(String)
    http_response = HttpResponseFormat.new(nil, nil, nil, http_response)
  end
  item = Item.new(http_response, id, prev_id)
  super_publish_async(channel, item, callback)
end

#publish_http_stream(channel, http_stream, id = nil, prev_id = nil) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/grippubcontrol.rb', line 31

def publish_http_stream(channel, http_stream, id=nil, prev_id=nil)
  if http_stream.is_a?(String)
    http_stream = HttpStreamFormat.new(http_stream)
  end
  item = Item.new(http_stream, id, prev_id)
  super_publish(channel, item)
end

#publish_http_stream_async(channel, http_stream, id = nil, prev_id = nil, callback = nil) ⇒ Object



39
40
41
42
43
44
45
46
# File 'lib/grippubcontrol.rb', line 39

def publish_http_stream_async(channel, http_stream, id=nil,
    prev_id=nil, callback=nil)
  if http_stream.is_a?(String)
    http_stream = HttpStreamFormat.new(http_stream)
  end
  item = Item.new(http_stream, id, prev_id)  
  super_publish_async(channel, item, callback)
end