{"id":19316066,"url":"https://github.com/socketry/async-worker","last_synced_at":"2025-04-22T16:33:14.239Z","repository":{"id":62553668,"uuid":"129178846","full_name":"socketry/async-worker","owner":"socketry","description":null,"archived":false,"fork":false,"pushed_at":"2020-02-29T11:18:51.000Z","size":16,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-08T18:26:17.132Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/socketry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-12T02:06:00.000Z","updated_at":"2021-11-03T21:35:34.000Z","dependencies_parsed_at":"2022-11-03T04:45:27.351Z","dependency_job_id":null,"html_url":"https://github.com/socketry/async-worker","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketry%2Fasync-worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketry%2Fasync-worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketry%2Fasync-worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketry%2Fasync-worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/socketry","download_url":"https://codeload.github.com/socketry/async-worker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223900219,"owners_count":17222028,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-10T01:09:44.641Z","updated_at":"2024-11-10T01:09:45.598Z","avatar_url":"https://github.com/socketry.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Async::Worker\n\nProvides a thread-pool backed work queue for executing blocking operations in a non-blocking fashion using [async]. **Experimental**\n\n[async]: https://github.com/socketry/async\n\n[![Build Status](https://travis-ci.com/socketry/async-worker.svg)](https://travis-ci.com/socketry/async-worker)\n[![Code Climate](https://codeclimate.com/github/socketry/async-worker.svg)](https://codeclimate.com/github/socketry/async-worker)\n[![Coverage Status](https://coveralls.io/repos/socketry/async-worker/badge.svg)](https://coveralls.io/r/socketry/async-worker)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'async-worker'\n```\n\nAnd then execute:\n\n\t$ bundle\n\nOr install it yourself as:\n\n\t$ gem install async-worker\n\n## Usage\n\nCreate a pool and execute jobs using it:\n\n```ruby\nAsync::Reactor.run do |task|\n\t# Make a pool with two workers:\n\tpool = Async::Worker::Pool.new(2)\n\t\n\ttasks = 5.times.collect do\n\t\ttask.async do\n\t\t\t# Add the work to the queue and wait for it to complete:\n\t\t\tpool.async do\n\t\t\t\tsleep 0.1\n\t\t\tend\n\t\tend\n\tend\n\t\n\ttasks.each(\u0026:wait)\n\t\n\tpool.close\nend\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## See Also\n\n- [async-container](https://github.com/socketry/async-container) — A container for parallel execution.\n\n## License\n\nReleased under the MIT license.\n\nCopyright, 2017, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams).\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTWorkerN OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTWorkerN WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketry%2Fasync-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocketry%2Fasync-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketry%2Fasync-worker/lists"}