Sha256: ed66036bd8dc768236933f507102601a626adb4c9aefe8c48e7870db9492515e

Contents?: true

Size: 387 Bytes

Versions: 41

Compression:

Stored size: 387 Bytes

Contents

# frozen_string_literal: true

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

41 entries across 41 versions & 1 rubygems

Version Path
bolt-0.18.0 lib/bolt/notifier.rb