Public
Authored by Hermann Mayer

Ruby Forking and TLVs

The thread objects stay the "same" as the parent memory is copied down to the forked child, so watch out for bad TLVs values.

See:

Puma

before_fork do
  Sequel::DATABASES.each(&:disconnect)
end

Parallel

If you’re using the Parallel gem with processes, you should disconnect before calling it:

Sequel::DATABASES.each(&:disconnect)
Parallel.map(['a','b','c'], in_processes: 3) { |one_letter| }
Edited
example.rb 270 Bytes
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment