Sha256: e88c06fbdeace35673849c152c9edb81b68fd20362e812249ed6f6a4913f4a3b

Contents?: true

Size: 308 Bytes

Versions: 2

Compression:

Stored size: 308 Bytes

Contents

module EventSourcery
  module EventStore
    class PollWaiter
      def initialize(interval: 0.5)
        @interval = interval
      end

      def poll(&block)
        catch(:stop) do
          loop do
            block.call
            sleep @interval
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
event_sourcery-0.14.0 lib/event_sourcery/event_store/poll_waiter.rb
event_sourcery-0.13.0 lib/event_sourcery/event_store/poll_waiter.rb