Module: DDP::Server::Protocol::Heartbeat

Included in:
DDP::Server::Protocol
Defined in:
lib/ddp/server/protocol/heartbeat.rb

Overview

Protocol regarding heartbeat messages

Instance Method Summary collapse

Instance Method Details

#handle_heartbeatObject



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/ddp/server/protocol/heartbeat.rb', line 6

def handle_heartbeat
  case @message['msg']
  when 'ping'
    write_message msg: 'pong', id: @message['id']
    true
  when 'pong'
    true
  else
    false
  end
end