Sha256: 41ca6b8c7854fc3a87442afab7d33ad81c411fe7cce683a3573fd51415991e67

Contents?: true

Size: 372 Bytes

Versions: 2

Compression:

Stored size: 372 Bytes

Contents

module Concurrent
  module Actor
    module Behaviour
      # Terminates all children when the actor terminates.
      class TerminatesChildren < Abstract
        def on_event(public, event)
          event_name, _ = event
          children.map { |ch| ch << :terminate! } if event_name == :terminated
          super public, event
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
concurrent-ruby-edge-0.1.0.pre3 lib/concurrent/actor/behaviour/terminates_children.rb
concurrent-ruby-edge-0.1.0.pre2 lib/concurrent/actor/behaviour/terminates_children.rb