Questions tagged [concurrent-ruby]

Concurrency library inspired by Erlang, Clojure, Scala, Haskell, F#, C#, Java, and others. Use this tag for questions related to the concurrent-ruby gem.

Concurrent Ruby is a concurrency library for Ruby inspired by Erlang, Clojure, Scala, Haskell, F#, C#, Java, and others, providing abstractions for agents, futures, promises, thread pools, supervisors, and more.

Documentation, source code, and other information at http://www.concurrent-ruby.com/.

21 questions
0
votes
0 answers

How to properly set up heavy work in concurrency?

There are 1 million customers. I need to send them in batches to a third-party service, get a response and process. the same code for 500_000 customers works. thread_pool = Concurrent::FixedThreadPool.new(100) executors =…
evans
  • 549
  • 7
  • 22
0
votes
1 answer

ActiveRecord transactions: record created but not found in database

We're using Rails v6.0.2.1 on Jruby with managed PostgreSQL (using JDBC adapter) hosted on DigitalOcean. Lately, we have been seeing issues where a certain transaction created some record, threw the Id to Sidekiq for further processing but the…
Anil Kumar
  • 459
  • 6
  • 16
0
votes
2 answers

How to cancel other futures?

I am creating multiple futures and I am expecting only one to achieve the desired goal. How can I cancel all other futures from within a future? This is how I create futures: jobs = days_to_scan.map{|day| Concurrent::Future.execute do …
simo
  • 23,342
  • 38
  • 121
  • 218
0
votes
1 answer

How can I call a block within the execute method of a ScheduledTask?

I'm trying to call a block within the Concurrent::ScheduledTask#execute method, but the block itself never is executed. I also tried using Concurrent::ScheduledTask#new method, but the results are the same. I feel there may be a fundamental issue…
0
votes
2 answers

Rails install suddenly requires concurrent-ruby gem and fails

After a system upgrade to macOS 10.14 I am suddenly unable to install Rails 3.2.5 on Ruby 1.8.7, since a new gem is required now: Concurrent-ruby. I was able to install and use this system on macOS 10.13. Why is concurrent-ruby suddenly a…
SEJU
  • 995
  • 1
  • 9
  • 28
0
votes
1 answer

Thread safe counter inside a method

I saw some retry code written like this, it tries to call a service 3 times if some exception is raised, Im trying to understand in a non-MRI multi-threaded server, is this counter thread safe? is it necessary to lock the process using Mutex? This…
user1883793
  • 4,011
  • 11
  • 36
  • 65
1
2