Sha256: 58ce41a43e6032ea8cf1067639ea83cb00abd0d079ddfee2d0d0b8c5ff06c7da

Contents?: true

Size: 370 Bytes

Versions: 7

Compression:

Stored size: 370 Bytes

Contents

require 'concurrent'

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

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

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bolt-0.14.0 lib/bolt/notifier.rb
bolt-0.13.0 lib/bolt/notifier.rb
bolt-0.12.0 lib/bolt/notifier.rb
bolt-0.11.0 lib/bolt/notifier.rb
bolt-0.10.0 lib/bolt/notifier.rb
bolt-0.9.0 lib/bolt/notifier.rb
bolt-0.8.0 lib/bolt/notifier.rb