Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/digital-fabric/polyphony
Fine-grained concurrency for Ruby
https://github.com/digital-fabric/polyphony
concurrency io-uring iouring libev networking polyphony ruby ruby-fibers structured-concurrency
Last synced: about 2 months ago
JSON representation
Fine-grained concurrency for Ruby
- Host: GitHub
- URL: https://github.com/digital-fabric/polyphony
- Owner: digital-fabric
- License: mit
- Created: 2018-08-20T06:22:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-25T09:56:08.000Z (9 months ago)
- Last Synced: 2024-09-30T23:17:27.762Z (3 months ago)
- Topics: concurrency, io-uring, iouring, libev, networking, polyphony, ruby, ruby-fibers, structured-concurrency
- Language: C
- Homepage: https://www.rubydoc.info/gems/polyphony
- Size: 2.96 MB
- Stars: 658
- Watchers: 14
- Forks: 17
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-io_uring - polyphony - Fiber-based (Ruby)
- awesome-list - polyphony - grained concurrency for Ruby | digital-fabric | 265 | (C)
README
# Polyphony: Fine-Grained Concurrency for Ruby
> Polyphony \| pəˈlɪf\(ə\)ni \|
>
> 1. _Music_ the style of simultaneously combining a number of parts, each
> forming an individual melody and harmonizing with each other.
>
> 2. _Programming_ a Ruby gem for concurrent programming focusing on performance
> and developer happiness.## What is Polyphony?
Polyphony is a library for building concurrent applications in Ruby. Polyphony
harnesses the power of [Ruby fibers](https://rubyapi.org/3.2/o/fiber) to provide
a cooperative, sequential coroutine-based concurrency model. Under the hood,
Polyphony uses [io_uring](https://unixism.net/loti/what_is_io_uring.html) or
[libev](https://github.com/enki/libev) to maximize I/O performance.## Features
* Ruby fibers as the main unit of concurrency.
* [Structured concurrency](https://en.wikipedia.org/wiki/Structured_concurrency)
coupled with robust exception handling.
* Message passing between fibers, even across threads!
* High-performance I/O using the core Ruby I/O classes and
[io_uring](https://unixism.net/loti/what_is_io_uring.html) with support for
[advanced I/O patterns](docs/advanced-io.md).## Usage
- [Installation](docs/installation.md)
- [Overview](docs/overview.md)
- [Tutorial](docs/tutorial.md)
- [All About Cancellation: How to Stop Concurrent Operations](docs/cancellation.md)
- [Advanced I/O with Polyphony](docs/advanced-io.md)
- [Cheat-Sheet](docs/cheat-sheet.md)
- [FAQ](docs/faq.md)## Technical Discussion
- [Concurrency the Easy Way](docs/concurrency.md)
- [How Fibers are Scheduled](docs/fiber-scheduling.md)
- [Exception Handling](docs/exception-handling.md)
- [Extending Polyphony](docs/extending.md)
- [Polyphony's Design](docs/design-principles.md)## Examples
For examples of specific use cases you can consult the [bundled
examples](https://github.com/digital-fabric/polyphony/tree/master/examples) in
Polyphony's GitHub repository.## Contributing to Polyphony
Issues and pull requests will be gladly accepted. Please use the [Polyphony git
repository](https://github.com/digital-fabric/polyphony) as your primary point
of departure for contributing.