Ruby: Any gems for threadpooling?

前端 未结 2 366
南笙
南笙 2021-01-06 22:03

Is there a gem for threadpooling anyone can recommend?

2条回答
  •  借酒劲吻你
    2021-01-06 22:25

    I would try https://github.com/ruby-concurrency/concurrent-ruby/ .

    It's basically a port of the java.util.concurrent abstractions (including threadpools) to ruby -- except if you install it under Jruby, it'll use the java.util.concurrent stuff. So you can write code that'll work and do the same thing semantically (not neccesarily the same performance) under any ruby platform.

    It also offers Futures, a higher level abstraction which may be more convenient to use than thread pools.

提交回复
热议问题