Class: ActiveSupport::Testing::Parallelization
Do not use. This class is for internal use only.
Relationships & Source Files | |
Namespace Children | |
Classes:
| |
Inherits: | Object |
Defined in: | activesupport/lib/active_support/testing/parallelization.rb, activesupport/lib/active_support/testing/parallelization/server.rb, activesupport/lib/active_support/testing/parallelization/worker.rb |
Class Attribute Summary
- .after_fork_hooks (also: #after_fork_hooks) readonly
- .run_cleanup_hooks (also: #run_cleanup_hooks) readonly
Class Method Summary
Instance Attribute Summary
- #after_fork_hooks readonly
- #run_cleanup_hooks readonly
Instance Method Summary
Constructor Details
.new(worker_count) ⇒ Parallelization
Class Attribute Details
.after_fork_hooks (readonly) Also known as: #after_fork_hooks
[ GitHub ]# File 'activesupport/lib/active_support/testing/parallelization.rb', line 18
cattr_reader :after_fork_hooks
.run_cleanup_hooks (readonly) Also known as: #run_cleanup_hooks
[ GitHub ]# File 'activesupport/lib/active_support/testing/parallelization.rb', line 26
cattr_reader :run_cleanup_hooks
Class Method Details
.after_fork_hook(&blk)
[ GitHub ]# File 'activesupport/lib/active_support/testing/parallelization.rb', line 14
def self.after_fork_hook(&blk) @@after_fork_hooks << blk end
.run_cleanup_hook(&blk)
[ GitHub ]# File 'activesupport/lib/active_support/testing/parallelization.rb', line 22
def self.run_cleanup_hook(&blk) @@run_cleanup_hooks << blk end
Instance Attribute Details
#after_fork_hooks (readonly)
[ GitHub ]# File 'activesupport/lib/active_support/testing/parallelization.rb', line 18
cattr_reader :after_fork_hooks
#run_cleanup_hooks (readonly)
[ GitHub ]# File 'activesupport/lib/active_support/testing/parallelization.rb', line 26
cattr_reader :run_cleanup_hooks
Instance Method Details
#<<(work)
[ GitHub ]# File 'activesupport/lib/active_support/testing/parallelization.rb', line 41
def <<(work) @queue_server << work end
#shutdown
[ GitHub ]# File 'activesupport/lib/active_support/testing/parallelization.rb', line 49
def shutdown @queue_server.shutdown @worker_pool.each { |pid| Process.waitpid pid } end
#size
[ GitHub ]# File 'activesupport/lib/active_support/testing/parallelization.rb', line 45
def size @worker_count end