{"id":16899968,"url":"https://github.com/alindeman/rector","last_synced_at":"2025-10-19T07:03:47.593Z","repository":{"id":2385075,"uuid":"3350716","full_name":"alindeman/rector","owner":"alindeman","description":"Rector coordinates parallelized jobs that generate metrics or other data together","archived":false,"fork":false,"pushed_at":"2012-02-09T20:20:54.000Z","size":121,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T04:19:10.773Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alindeman.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":"2012-02-04T04:16:15.000Z","updated_at":"2017-06-15T08:03:48.000Z","dependencies_parsed_at":"2022-09-09T19:11:24.232Z","dependency_job_id":null,"html_url":"https://github.com/alindeman/rector","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/alindeman/rector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alindeman%2Frector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alindeman%2Frector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alindeman%2Frector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alindeman%2Frector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alindeman","download_url":"https://codeload.github.com/alindeman/rector/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alindeman%2Frector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279731226,"owners_count":26217645,"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-10-19T02:00:07.647Z","response_time":64,"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":"2024-10-13T17:51:07.686Z","updated_at":"2025-10-19T07:03:47.546Z","avatar_url":"https://github.com/alindeman.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rector\n\n[![Build Status](https://secure.travis-ci.org/alindeman/rector.png)](http://travis-ci.org/alindeman/rector)\n\nRector allows coordination of a number of jobs spawned with a mechanism\nlike Resque (though any job manager will do). If you are able to parallelize\nthe processing of a task, yet all these tasks are generating metrics,\nstatistics, or other data that need to be combined, Rector might be for you.\n\n## Requirements\n\n* Ruby \u003e= 1.9.2 (or 1.9 mode of JRuby or Rubinius)\n\n## Configuration\n\nRector currently supports Redis as a backend for job coordination and\ndata storage.\n\n### Redis Server\n\n```ruby\nRector.configure do |c|\n  c.redis = Redis.new(:host =\u003e \"10.0.1.1\", :port =\u003e 6380)\nend\n```\n\n## Job Creation (Master)\n\nRector requires that some process be designated as the \"master\" process.\nThis is usually the process that is also responsible for spawning the\nworker jobs.\n\n```ruby\njob = Rector::Job.new\n\n# e.g., processing files in parallel\nfiles.each do |file|\n  worker = job.workers.create\n\n  # e.g., using Resque for job management; Rector doesn't really care\n  Resque.enqueue(WordCounterJob, worker.id, file)\nend\n\n# wait for all the workers to complete\njob.join\n\n# get aggregated data from all the jobs\njob.data.each do |word, count|\n  puts \"#{word} was seen #{count} times across all files\"\nend\n\njob.cleanup\n```\n\n## Job Processing (Workers)\n\n```ruby\nclass ProcessFileJob\n  def self.perform(worker_id, file)\n    worker = Rector::Worker.new(worker_id)\n\n    words = File.read(file).split(/\\W/)\n    words.reject(\u0026:blank?).each do |word|\n      worker.data[word] ||= 0 \n      worker.data[word]  += 1\n    end\n\n    worker.finish\n  end\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falindeman%2Frector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falindeman%2Frector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falindeman%2Frector/lists"}