Created
July 25, 2019 19:07
-
-
Save gipsh/b6cc9157e0b53fe2e3fc8b299cf13414 to your computer and use it in GitHub Desktop.
concurrency thread pool
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
require 'concurrent-ruby' | |
$pool = Concurrent::FixedThreadPool.new(2) | |
$pool.post do | |
{your function or block} | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment