pitr-ch on master
Add names to global pools formatting Add missing require and 3 more (compare)
pitr-ch on master
Adds WrappingExecutor class Th… Generates docs for WrappingExec… Update documentation and 4 more (compare)
Concurrent::Promises.fulfilled_future(true)and this breaks later on with this error:
TypeError: returned value true is not a Future. However, if I do something like:
f = Concurrent::Promises.fulfilled_future(true); logger.info("HELLO WORLD"); return fthen everything works fine....
.then_on(pool, upload, &method(:method_that_returns_a_future)), and when that looks like this:
.then_on(pool, upload, &method(:method_that_returns_a_future)).flat_futureI get that error
FIXME this leads to weird message processing orderingand is one of the "edge" features. So this may just be a buggy test and probably shouldn't prevent us from merging. Can you please comment out the test on line 191 of
spec/concurrent/actor_spec.rband see if it passes CI? If that works we may just temporarily disable the test and merge your change.
Hi, I'm looking for a advice about how to implement the following schema:
I want to share a thread pool among several workers (separate threads), to parallelize I/O bounded tasks using Futures, I would like to have each worker to use 10 threads at most, and no more that 50 in total for the whole process, I wanted to know if there's some recommend way to configure a thread pool for such use case?.
I would like to keep threads on the pool alive for a while (I'm using 2 minutes although I'm not sure if that's the best option), since the previous approach I had (parallel gem) was creating a new Thread for each new task and the memory usage kept going up fast, since Ruby doesn't seem to return the resources to the OS fast enough.
The best solution I could come up with is this: https://gist.github.com/pabloh/94c5dd1ead2ed8bc26dfbba600691f89, that's close to what I want but I don't know if that idle time is a good choice, or how to limit the max number of threads used per worker to just 10.
BTW I'm on CRuby 2.6.5 and sadly I can't use an async solution for the time being since the whole codebase I have is already implemented as blocking.