Skip to content

Commit

Permalink
Containers for reactors.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Jun 15, 2017
1 parent 41bed12 commit 6595cc6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/async/container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
require 'thread'

module Async
# TODO Move this into it's own gem, since it's really not required for async to work - it's only really for servers and this implementation is very basic.
# Manages a reactor within one or more threads.
module Container
def self.new(klass: ThreadContainer, **options, &block)
Expand All @@ -37,6 +38,8 @@ def initialize(concurrency: 1, &block)

@threads = @reactors.collect do |reactor|
Thread.new do
Thread.current.abort_on_exception = true

reactor.run(&block)
end
end
Expand Down

0 comments on commit 6595cc6

Please sign in to comment.