Sha256: 0856e5ddebe60cae69b2dc738859955f20a64d9daf2d4e1561e3b8a1c8a2ee6d
Contents?: true
Size: 638 Bytes
Versions: 30
Compression:
Stored size: 638 Bytes
Contents
# Toplevel Pubnub module. module Pubnub # Heart takes responsibility of heartbeat event class Heart include Celluloid def initialize(options) @heartbeat = options[:heartbeat] @channel = options[:channel] @app = options[:app] end def start_beating beating = Timers::Group.new beat beating.every(@heartbeat) do Pubnub.logger.debug('Pubnub') { 'Heartbeat!' } beat end loop { beating.wait } end def beat @app.heartbeat( channel: @channel, heartbeat: @heartbeat, http_sync: true ) end end end
Version data entries
30 entries across 30 versions & 1 rubygems