Created
January 9, 2021 19:23
-
-
Save vitobotta/89e86bddd88d8d0de2e80f3f29621e46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveSupport | |
module Testing | |
class Parallelization # :nodoc: | |
class Worker | |
def start | |
fork do | |
set_process_title("(starting)") | |
DRb.stop_service | |
@queue = DRbObject.new_with_uri(@url) | |
@queue.start_worker(@id) | |
begin | |
Spring.after_fork do | |
after_fork | |
end | |
rescue => @setup_exception; end | |
work_from_queue | |
ensure | |
set_process_title("(stopping)") | |
run_cleanup | |
@queue.stop_worker(@id) | |
end | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment