A Ruby library for fine-grained concurrency using fibers, structured concurrency, and high-performance I/O.
Polyphony is a Ruby library for building concurrent applications using a cooperative, coroutine-based model. It harnesses Ruby fibers to provide fine-grained concurrency, focusing on performance and developer-friendly abstractions. The library solves the complexity of concurrent programming in Ruby by offering structured concurrency and high-performance I/O through integrations like io_uring.
Ruby developers building concurrent applications, such as servers, data processing pipelines, or I/O-intensive systems, who need lightweight concurrency and high performance.
Developers choose Polyphony for its seamless integration with Ruby fibers, structured concurrency model that simplifies error handling, and high-performance I/O capabilities using io_uring or libev, making it a robust alternative to traditional threading or event-driven approaches.
Fine-grained concurrency for Ruby
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses Ruby fibers as the primary unit for lightweight task management, reducing overhead compared to threads, as highlighted in the features section.
Implements structured concurrency principles with strong exception handling, ensuring reliable concurrent workflows, described in the technical documentation.
Leverages io_uring or libev for optimized I/O operations, providing advanced patterns and maximum performance, as specified in the high-performance I/O feature.
Supports message passing between fibers, even across threads, facilitating inter-fiber communication, a key feature mentioned in the README.
Relies on io_uring for peak performance, which is only available on Linux, limiting cross-platform compatibility and requiring libev as a fallback.
Requires understanding of fibers, structured concurrency, and advanced I/O concepts, making it less accessible for developers new to these paradigms.
As a specialized library, it has fewer third-party integrations and community resources compared to mainstream Ruby concurrency approaches like threads or Async.