https://github.com/digital-fabric/polyphony Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this organization All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} digital-fabric / polyphony Public * * Notifications * Fork 14 * Star 523 Fine-grained concurrency for Ruby www.rubydoc.info/gems/polyphony License MIT license 523 stars 14 forks Star Notifications * Code * Issues 1 * Pull requests 0 * Discussions * Actions * Wiki * Security * Insights More * Code * Issues * Pull requests * Discussions * Actions * Wiki * Security * Insights digital-fabric/polyphony This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 6 branches 24 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/d] Use Git or checkout with SVN using the web URL. [gh repo clone digita] Work fast with our official CLI. Learn more about the CLI. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @noteflakes noteflakes Version 1.0 ... 594f1e4 May 11, 2023 Version 1.0 594f1e4 Git stats * 1,638 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github Fix doc links May 8, 2023 11:33 .vscode Add fiber ping pong example June 13, 2019 01:07 bin Use POLYPHONY_LIBEV instead of POLYPHONY_USE_LIBEV env var March 4, 2022 09:39 docs Refactor Object extensions (remove GlobalAPI module) May 11, 2023 11:54 examples Remove trailing whitespace May 10, 2023 23:35 ext Review usage of @yield [void] May 11, 2023 11:50 lib Version 1.0 May 11, 2023 17:25 test Remove trailing whitespace May 10, 2023 23:35 vendor Update liburing March 9, 2023 06:56 .gitignore Remove Gemfile.lock October 31, 2022 12:14 .gitmodules Add liburing as git submodule in /vendor March 11, 2022 13:43 .rubocop.yml Refactor Object extensions (remove GlobalAPI module) May 11, 2023 11:54 .yardopts Refactor Object extensions (remove GlobalAPI module) May 11, 2023 11:54 CHANGELOG.md Version 1.0 May 11, 2023 17:25 Gemfile Restore Gemfile October 31, 2022 12:17 LICENSE Overhaul docs May 8, 2023 11:19 README.md Cleanup doc files May 11, 2023 07:00 Rakefile Overhaul docs May 8, 2023 11:19 TODO.md Fix flaky tests May 3, 2023 07:27 polyphony.gemspec Overhaul docs May 8, 2023 11:19 View code [ ] Polyphony: Fine-Grained Concurrency for Ruby What is Polyphony? Features Installing System Requirements Installing the Polyphony Gem Usage Technical Discussion Examples Contributing to Polyphony README.md [polyphony-] Polyphony: Fine-Grained Concurrency for Ruby Ruby gem Tests MIT License Polyphony | p@'lIf(@)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 to provide a cooperative, sequential coroutine-based concurrency model. Under the hood, Polyphony uses io_uring or libev to maximize I/O performance. Features * Co-operative scheduling of concurrent tasks using Ruby fibers. * High-performance event reactor for handling I/O events and timers. * Natural, sequential programming style that makes it easy to reason about concurrent code. * Abstractions and constructs for controlling the execution of concurrent code: supervisors, cancel scopes, throttling, resource pools etc. * Code can use native networking classes and libraries, growing support for third-party gems such as pg and redis. * Use stdlib classes such as TCPServer, TCPSocket and OpenSSL::SSL::SSLSocket. * Competitive performance and scalability characteristics, in terms of both throughput and memory consumption. Installing System Requirements In order to use Polyphony you need to have: * Linux or MacOS (support for Windows will come at a later stage) * Ruby (MRI) 3.0 or newer Installing the Polyphony Gem Add this line to your application's Gemfile: gem 'polyphony' And then execute: $ bundle Or install it yourself as: $ gem install polyphony Usage * Overview * Tutorial * FAQ Technical Discussion * Concurrency the Easy Way * How Fibers are Scheduled * Exception Handling * Extending Polyphony * Polyphony's Design Examples For examples of specific use cases you can consult the bundled examples in Polyphony's GitHub repository. Contributing to Polyphony Issues and pull requests will be gladly accepted. Please use the Polyphony git repository as your primary point of departure for contributing. About Fine-grained concurrency for Ruby www.rubydoc.info/gems/polyphony Topics ruby networking concurrency libev structured-concurrency polyphony io-uring iouring ruby-fibers Resources Readme License MIT license Stars 523 stars Watchers 12 watching Forks 14 forks Report repository Sponsor this project Sponsor Learn more about GitHub Sponsors Used by 12 * @jsaak * @gabriel-aires * @digital-fabric * @dm1try * @noteflakes * @timhatch * @digital-fabric * @digital-fabric + 4 Contributors 7 * @noteflakes * @wjordan * @floriandejonckheere * @ElMassimo * @misfo * @dezza * @ttilberg Languages * C 62.1% * Ruby 37.9% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. 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.