Class: EventMachine::RTMP::Heartbeat
Instance Attribute Summary
#state
Instance Method Summary
collapse
#bytes_waiting, #change_state, #read, #write
Methods included from IOHelpers
#read_bitfield, #read_double_be, #read_int29, #read_safe, #read_uint16_be, #read_uint24_be, #read_uint32_be, #read_uint32_le, #read_uint8, #write_bitfield, #write_double_be, #write_int29, #write_uint16_be, #write_uint24_be, #write_uint32_be, #write_uint32_le, #write_uint8
Constructor Details
#initialize(connection) ⇒ Heartbeat
Returns a new instance of Heartbeat.
5
6
7
|
# File 'lib/em-rtmp/heartbeat.rb', line 5
def initialize(connection)
super connection
end
|
Instance Method Details
#buffer_changed ⇒ Object
9
10
11
|
# File 'lib/em-rtmp/heartbeat.rb', line 9
def buffer_changed
end
|
#cancel ⇒ Object
29
30
31
32
|
# File 'lib/em-rtmp/heartbeat.rb', line 29
def cancel
@timer.cancel
@timer = nil
end
|
#pulse ⇒ Object
25
26
27
|
# File 'lib/em-rtmp/heartbeat.rb', line 25
def pulse
@block.call
end
|
#start ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/em-rtmp/heartbeat.rb', line 13
def start
@timer ||= EventMachine::PeriodicTimer.new(15) do
pulse
end
@block = Proc.new do
Logger.debug "Heartbeat Pulsing"
end
@block.call
end
|