Sha256: 72d707024bcc2265853771bf4e8a62b394cbe49e1cba6efc16de973bde968273
Contents?: true
Size: 363 Bytes
Versions: 18
Compression:
Stored size: 363 Bytes
Contents
# frozen_string_literal: true module Kafka class Heartbeat def initialize(group:, interval:) @group = group @interval = interval @last_heartbeat = Time.now end def trigger! @group.heartbeat @last_heartbeat = Time.now end def trigger trigger! if Time.now > @last_heartbeat + @interval end end end
Version data entries
18 entries across 18 versions & 1 rubygems