Overview of the Promises framework
masterThe Promises framework in concurrent-ruby unifies several older concurrency tools (Concurrent::Future, Concurrent::Promise, Concurrent::IVar, Concurrent::Event, Concurrent.dataflow, Delay, and TimerTask) into a single, cohesive system.
Key capabilities include:
- Asynchronous Task Processing: Process tasks without blocking the main execution flow.
- Task Composition: Chain, branch, and zip asynchronous tasks to create Directed Acyclic Graphs (DAGs).
- Scheduling: Create delayed or scheduled tasks.
- Error Handling: Manage failures through rejections.
- Concurrency Control: Manage the level of concurrency and simulate massive amounts of parallel processing (tens of thousands of tasks) on a single thread pool without occupying individual threads.
- Integration: Seamlessly combine promises with actors and channels.
- Back Pressure: Build parallel processing stream systems that can signal components to slow down when they cannot keep up.