{"id":18728886,"url":"https://github.com/rubyonworld/m-ruby-concurrently","last_synced_at":"2026-04-30T14:31:29.413Z","repository":{"id":59947787,"uuid":"540252954","full_name":"RubyOnWorld/m-ruby-concurrently","owner":"RubyOnWorld","description":"Concurrently is a concurrency framework for Ruby and mruby built upon fibers.","archived":false,"fork":false,"pushed_at":"2022-09-23T02:44:14.000Z","size":575,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-19T20:33:06.986Z","etag":null,"topics":["concurrently","fiber","framework","mruby","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RubyOnWorld.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-23T02:43:48.000Z","updated_at":"2022-09-27T21:03:08.000Z","dependencies_parsed_at":"2022-09-25T09:43:21.919Z","dependency_job_id":null,"html_url":"https://github.com/RubyOnWorld/m-ruby-concurrently","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RubyOnWorld/m-ruby-concurrently","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fm-ruby-concurrently","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fm-ruby-concurrently/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fm-ruby-concurrently/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fm-ruby-concurrently/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RubyOnWorld","download_url":"https://codeload.github.com/RubyOnWorld/m-ruby-concurrently/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyOnWorld%2Fm-ruby-concurrently/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32468009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["concurrently","fiber","framework","mruby","ruby"],"created_at":"2024-11-07T14:24:38.029Z","updated_at":"2026-04-30T14:31:29.396Z","avatar_url":"https://github.com/RubyOnWorld.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Concurrently\n\n[![Build Status](https://secure.travis-ci.org/christopheraue/m-ruby-concurrently.svg?branch=master)](http://travis-ci.org/christopheraue/m-ruby-concurrently)\n\nConcurrently is a concurrency framework for Ruby and mruby built upon\nfibers. With it code can be evaluated independently in its own execution\ncontext similar to a thread. Execution contexts are called *evaluations* in\nConcurrently and are created with [Kernel#concurrently][]:\n\n```ruby\nhello = concurrently do\n  wait 0.2 # seconds\n  \"hello\"\nend\n\nworld = concurrently do\n  wait 0.1 # seconds\n  \"world\"\nend\n\nputs \"#{hello.await_result} #{world.await_result}\" \n```\n\nIn this example we have three evaluations: The root evaluation and two more\nconcurrent evaluations started by said root evaluation. The root evaluation\nwaits until both concurrent evaluations were concluded and then prints \"hello\nworld\".\n\n\n## Synchronization with events\n\nEvaluations can be synchronized with certain events by waiting for them. These\nevents are:\n\n* an elapsed time period ([Kernel#wait][]),\n* readability and writability of IO ([IO#await_readable][],\n  [IO#await_writable][]) and\n* the result of another evaluation ([Concurrently::Proc::Evaluation#await_result][]).\n\nSince evaluations run independently they are not blocking other evaluations\nwhile waiting.\n\n\n## Concurrent I/O\n\nWhen doing I/O it is important to do it **non-blocking**. If the IO object is\nnot ready use [IO#await_readable][] and [IO#await_writable][] to await\nreadiness.\n\nFor more about non-blocking I/O, see the core ruby docs for\n[IO#read_nonblock][] and [IO#write_nonblock][].\n\nThis is a little server reading from an IO and printing the received messages:\n\n```ruby\n# Let's start with creating a pipe to connect client and server\nr,w = IO.pipe\n\n# Server:\n# We let the server code run concurrently so it runs independently. It reads\n# from the pipe non-blocking and awaits readability if the pipe is not readable.\nconcurrently do\n  while true\n    begin\n      puts r.read_nonblock 32\n    rescue IO::WaitReadable\n      r.await_readable\n      retry\n    end\n  end\nend\n\n# Client:\n# The client writes to the pipe every 0.5 seconds\nputs \"#{Time.now.strftime('%H:%M:%S.%L')} (Start time)\"\nwhile true\n  wait 0.5\n  w.write Time.now.strftime('%H:%M:%S.%L')\nend\n```\n\nThe root evaluation is effectively blocked by waiting or writing messages.\nBut since the server runs concurrently it is not affected by this and happily\nprints its received messages.\n\nThis is the output:\n\n```\n23:20:42.357 (Start time)\n23:20:42.858\n23:20:43.359\n23:20:43.860\n23:20:44.360\n...\n```\n\n\n## Documentation\n\n* [Installation][installation]\n* [An Overview of Concurrently][overview]\n* [API documentation][documentation]\n* [Troubleshooting][troubleshooting]\n* [Performance][performance]\n\n\n## Supported Ruby Versions\n\n* Ruby 2.2.7+\n* mruby 1.3+\n\n\n## Development\n\n[Release Notes][release_notes]\n\n\n## License\n\nCopyright 2016-present Christopher Aue\n\nConcurrently is licensed under the Apache License, Version 2.0. Please see the\nfile called LICENSE.\n\n\n[Kernel#concurrently]: http://www.rubydoc.info/github/christopheraue/m-ruby-concurrently/Kernel#concurrently-instance_method\n[Kernel#wait]: http://www.rubydoc.info/github/christopheraue/m-ruby-concurrently/Kernel#wait-instance_method\n[IO#await_readable]: http://www.rubydoc.info/github/christopheraue/m-ruby-concurrently/IO#await_readable-instance_method\n[IO#await_writable]: http://www.rubydoc.info/github/christopheraue/m-ruby-concurrently/IO#await_writable-instance_method\n[Concurrently::Proc::Evaluation#await_result]: http://www.rubydoc.info/github/christopheraue/m-ruby-concurrently/Concurrently/Proc/Evaluation#await_result-instance_method\n[IO#read_nonblock]: https://ruby-doc.org/core/IO.html#method-i-read_nonblock\n[IO#write_nonblock]: https://ruby-doc.org/core/IO.html#method-i-write_nonblock\n\n[installation]: http://www.rubydoc.info/github/christopheraue/m-ruby-concurrently/file/guides/Installation.md\n[overview]: http://www.rubydoc.info/github/christopheraue/m-ruby-concurrently/file/guides/Overview.md\n[documentation]: http://www.rubydoc.info/github/christopheraue/m-ruby-concurrently/index\n[troubleshooting]: http://www.rubydoc.info/github/christopheraue/m-ruby-concurrently/file/guides/Troubleshooting.md\n[performance]: http://www.rubydoc.info/github/christopheraue/m-ruby-concurrently/file/guides/Performance.md\n[release_notes]: http://www.rubydoc.info/github/christopheraue/m-ruby-concurrently/file/RELEASE_NOTES.md","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Fm-ruby-concurrently","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubyonworld%2Fm-ruby-concurrently","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyonworld%2Fm-ruby-concurrently/lists"}