You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am migrating my project from actix to coerce and I have a question about how CPU-bound tasks are managed. The example below shows the actix code to perform the fibonacci operation on 3 Arbiters. An arbiter is a single-threaded event loop that runs one or more actors. In this way, although the event loop is blocked by the fibonacci calculation, it is possible to perform 3 calculations in parallel.
How does Coerce work under the hood? I couldn't find anything about it in the documentation. How to perform 3 CPU-bound tasks in parallel as in the example?
The text was updated successfully, but these errors were encountered:
Coerce uses the tokio runtime under the hood. For CPU-intensive work I would most likely dispatch that work to a separate thread pool and notify the actor when the work is complete.
For this I would recommend using a library like Rayon, which offers a work-stealing thread pool: https://crates.io/crates/rayon
I can give you some examples on how you could achieve this with Coerce, if you'd like?
I am migrating my project from actix to coerce and I have a question about how CPU-bound tasks are managed. The example below shows the actix code to perform the fibonacci operation on 3 Arbiters. An arbiter is a single-threaded event loop that runs one or more actors. In this way, although the event loop is blocked by the fibonacci calculation, it is possible to perform 3 calculations in parallel.
How does Coerce work under the hood? I couldn't find anything about it in the documentation. How to perform 3 CPU-bound tasks in parallel as in the example?
The text was updated successfully, but these errors were encountered: