-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to mark workers as fork unsafe
When some part of an application is hard or impossible to make fork-safe, but rarely called, it's possible to simply mark the worker as fork unsafe, and rely on its siblings to fork the next generation. In the eventually where all the workers end up marked fork unsafe, no new generation will be spawned, unless of course one of the unsafe workers die and is replaced by a fresh one. So this is only meant as a workaround for infrequently called things.
- Loading branch information
Showing
4 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
use Rack::ContentLength | ||
use Rack::ContentType, "text/plain" | ||
run lambda { |env| | ||
Pitchfork::Info.no_longer_fork_safe! | ||
[ 200, {}, [ env.inspect << "\n" ] ] | ||
} |
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