concurrent-ruby
concurrent-ruby copied to clipboard
Modern concurrency tools including agents, futures, promises, thread pools, supervisors, and more. Inspired by Erlang, Clojure, Scala, Go, Java, JavaScript, and classic concurrency patterns.
It currently uses TimerSet which runs in IO pool and creates unnecessary threads.
If yout take a look at https://github.com/ruby-concurrency/concurrent-ruby/blob/bbeacbcebf72668ed04df0738df7e3a654f7c177/lib-edge/concurrent/lazy_register.rb#L61 you will see, that it has a bug. When block evaluation time is stochastic, then even 2 `register` calls will produce unpredictable result....
We've been using the Actor implementation from the edge in https://github.com/Dynflow/dynflow for a while and we've hit no issues. Seems like it might be ready to get promoted to the...
* Operating system: Linux * Ruby implementation: Ruby * `concurrent-ruby` version: 1.1.5 * `concurrent-ruby-edge` version: 0.5.0 Given this code: ``` require 'concurrent-edge' class WorkerActor < Concurrent::Actor::RestartingContext def on_event(event) puts "#{name}...
Ruby 2.5.0 introduced Struct keyword parameters by adding "keyword_init: true" optional parameter. Mutable / ImmutableStruct / SettableStruct don't have support for those.
A couple of times now I've been speaking to someone and they have a problem like this. ``` ruby pool = Concurrent::FixedThreadPool.new(Concurrent.processor_count) 1.upto 2000000 do |i| pool.post do # work...
Compare-and-set is a useful functionality (that's why it exists in the Java API). It can save one from race conditions, as explained below. ### Use case - Assume an atomicboolean...
Script as PoC: ```ruby puts "Start: #{Time.now}" task = Concurrent::TimerTask.execute(execution_interval: 3) { puts "In task: #{Time.now}" } sleep 4 task.shutdown puts "Restart: #{Time.now}" task.execute sleep 6 task.shutdown puts "End: #{Time.now}"...
- Operating system: linux - `concurrent-ruby` version: 1.0.5 - `concurrent-ruby-ext` installed: yes - `concurrent-ruby-edge` used: no If each time i shutdown and execute the timertask as example shown, there will...
- `concurrent-ruby` version: 1.0.4 - `concurrent-ruby-ext` installed: no - `concurrent-ruby-edge` used: no Take the following code: https://gist.github.com/eregon/323890bfff539f8a33f66d8b2f02cc99 Of course, its purpose is to create a deadlock but it means any...