Sha256: 4a0164e0630d98e8c901af99e374146a9c5814a6acbe586e1aacf8e08ea2ae14

Contents?: true

Size: 356 Bytes

Versions: 9

Compression:

Stored size: 356 Bytes

Contents

require 'concurrent'

module Bolt
  class Notifier
    def initialize(executor = Concurrent::SingleThreadExecutor.new)
      @executor = executor
    end

    def notify(callback, event)
      @executor.post do
        callback.call(event)
      end
    end

    def shutdown
      @executor.shutdown
      @executor.wait_for_termination
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
bolt-0.17.2 lib/bolt/notifier.rb
bolt-0.17.1 lib/bolt/notifier.rb
bolt-0.17.0 lib/bolt/notifier.rb
bolt-0.16.4 lib/bolt/notifier.rb
bolt-0.16.3 lib/bolt/notifier.rb
bolt-0.16.2 lib/bolt/notifier.rb
bolt-0.16.1 lib/bolt/notifier.rb
bolt-0.16.0 lib/bolt/notifier.rb
bolt-0.15.0 lib/bolt/notifier.rb