{"id":28364036,"url":"https://github.com/kwerle/threaded_pipeline","last_synced_at":"2025-09-06T05:38:59.171Z","repository":{"id":59157823,"uuid":"158867480","full_name":"kwerle/threaded_pipeline","owner":"kwerle","description":"A gem to make it easy to run multiple parts of a data pipeline (do step 1, then 2, then 3...) in threads.","archived":false,"fork":false,"pushed_at":"2022-05-07T17:59:13.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-24T00:35:44.366Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kwerle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-23T18:44:20.000Z","updated_at":"2022-05-07T17:59:16.000Z","dependencies_parsed_at":"2022-09-13T20:11:40.356Z","dependency_job_id":null,"html_url":"https://github.com/kwerle/threaded_pipeline","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kwerle/threaded_pipeline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwerle%2Fthreaded_pipeline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwerle%2Fthreaded_pipeline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwerle%2Fthreaded_pipeline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwerle%2Fthreaded_pipeline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kwerle","download_url":"https://codeload.github.com/kwerle/threaded_pipeline/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwerle%2Fthreaded_pipeline/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268248734,"owners_count":24219557,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-05-28T19:41:26.724Z","updated_at":"2025-08-01T15:10:42.909Z","avatar_url":"https://github.com/kwerle.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ThreadedPipeline\n\nBuild status: [![CircleCI](https://circleci.com/gh/kwerle/threaded_pipeline.svg?style=svg)](https://circleci.com/gh/kwerle/threaded_pipeline)\n\nRecently I have been doing a lot of the pattern:\n1. Download file from list of URLs\n1. Process file\n1. Record results\n\nPart 1 is network bound.  Part 2 is CPU bound.  Part 3 is service bound (database in my case).  There is no reason I should not run these three in parallel, so this gem is the encapsulation of the general pattern of running parts of a pipeline in parallel.\n\nGreatly inspired by the [parallel gem](https://github.com/grosser/parallel).\n\nTested with MRI and JRuby.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'threaded_pipeline'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install threaded_pipeline\n\n## Usage\n\n```\nthreaded_pipeline = ThreadedPipeline.new\nthreaded_pipeline.stages \u003c\u003c -\u003e (url) { fetch_large_csv(url) }\nthreaded_pipeline.stages \u003c\u003c -\u003e (local_file) { process_local_file(local_file) }\nthreaded_pipeline.stages \u003c\u003c -\u003e (processed_results) { record_results_in_database(processed_results) }\nresults = threaded_pipeline.process([list, of, large, csv, urls])\n```\n\nOr, if you want to feed it yourself - and also discard the results:\n\n```\nanother_pipeline = ThreadedPipeline.new(discard_results: true)\nanother_pipeline.stages \u003c\u003c -\u003e (url) { api_query(url) }\nanother_pipeline.stages \u003c\u003c -\u003e (returned_data) { process_returned_data(returned_data) }\nanother_pipeline.stages \u003c\u003c -\u003e (processed_results) { record_results_in_database(processed_results) }\nwhile url = web_crawl_urls\n  another_pipeline.feed(url)\nend\nanother_pipeline.finish\n```\n\nThis is even handy if you just want to process output from some other task in the background:\n\n```\nsimple_pipeline = ThreadedPipeline.new(discard_results: true)\nsimple_pipeline.stages \u003c\u003c -\u003e (some_data) { process_data(some_data) }\nwhile (some_data = some_object_that.generates_data)\n  simple_pipeline.feed(some_data)\nend\nsimple_pipeline.finish\n```\n\nWhich just encapsulates setting up the queue, settin up a completion condition/object, etc.\n\n## Development\n\nI use docker and guard.  `make guard`\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/threaded_pipeline.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwerle%2Fthreaded_pipeline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkwerle%2Fthreaded_pipeline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwerle%2Fthreaded_pipeline/lists"}