{"id":16946101,"url":"https://github.com/lsegal/mob_spawner","last_synced_at":"2025-04-11T16:31:27.489Z","repository":{"id":3241845,"uuid":"4278626","full_name":"lsegal/mob_spawner","owner":"lsegal","description":"Manages and spawns worker threads to run arbitrary shell commands.","archived":false,"fork":false,"pushed_at":"2012-05-10T00:35:18.000Z","size":96,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-02T05:33:32.123Z","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/lsegal.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-05-10T00:32:12.000Z","updated_at":"2015-01-02T17:38:57.000Z","dependencies_parsed_at":"2022-09-01T07:51:10.896Z","dependency_job_id":null,"html_url":"https://github.com/lsegal/mob_spawner","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/lsegal%2Fmob_spawner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsegal%2Fmob_spawner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsegal%2Fmob_spawner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsegal%2Fmob_spawner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lsegal","download_url":"https://codeload.github.com/lsegal/mob_spawner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223472809,"owners_count":17150745,"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-10-13T21:24:58.203Z","updated_at":"2024-11-07T07:06:35.102Z","avatar_url":"https://github.com/lsegal.png","language":"Ruby","readme":"# MobSpawner\n\nMobSpawner manages worker threads that can run arbitrary commands and report\nresults. Unlike distributed queues, MobSpawner is self-contained and perfect\nfor small batch scripts that need to run multiple independent jobs.\n\nDocumentation is on [rubydoc.org](http://rubydoc.org/gems/mob_spawner/frames).\n\n## Usage\n\nThe simplest usage of MobSpawner is:\n\n```ruby\ncommands = [\"rvm install 1.8.6\", \"rvm install 1.9.2\", \"rvm install rbx\"]\nMobSpawner.new(commands).run\n```\n\nThe above will attempt to run the 3 commands concurrently across the default of\n3 worker threads. By default commands do not report output; to get command\noutput, use callbacks discussed in the next section.\n\nFor more information on how to initialize a spawner, see the {MobSpawner}\ndocumentation.\n\n## Callbacks\n\nIn addition to simply running worker threads, you can also receive reports\nabout each worker's execution results using callbacks. To setup a spawner\nwith callbacks, use {MobSpawner#before_worker} and {MobSpawner#after_worker}:\n\n```ruby\nspawner = MobSpawner.new(\"command1\", \"command2\", \"command3\")\nspawner.before_worker do |data|\n  puts \"Worker #{data[:worker]} about to run #{data[:command].command}\"\nend\nspawner.after_worker do |data|\n  puts \"Worker #{data[:worker]} exited with status #{data[:status]}\"\n  puts \"Output:\"\n  puts data[:output]\nend\nspawner.run\n```\n\n## License \u0026 Copyright\n\nMobSpawner is licensed under the MIT license, \u0026copy; 2012 Loren Segal\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsegal%2Fmob_spawner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flsegal%2Fmob_spawner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsegal%2Fmob_spawner/lists"}