{"id":27197838,"url":"https://github.com/preaction/beam-worker","last_synced_at":"2025-06-12T11:03:22.767Z","repository":{"id":27961418,"uuid":"31454421","full_name":"preaction/Beam-Worker","owner":"preaction","description":"Task runner and Map-Reduce for the Beam framework","archived":false,"fork":false,"pushed_at":"2016-11-23T23:15:43.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-12T11:03:14.029Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/preaction.png","metadata":{"files":{"readme":"README","changelog":"CHANGES","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-28T07:06:14.000Z","updated_at":"2016-12-27T01:19:26.000Z","dependencies_parsed_at":"2022-08-01T09:08:56.466Z","dependency_job_id":null,"html_url":"https://github.com/preaction/Beam-Worker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/preaction/Beam-Worker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preaction%2FBeam-Worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preaction%2FBeam-Worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preaction%2FBeam-Worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preaction%2FBeam-Worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/preaction","download_url":"https://codeload.github.com/preaction/Beam-Worker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preaction%2FBeam-Worker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259453468,"owners_count":22860083,"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":"2025-04-09T20:29:43.675Z","updated_at":"2025-06-12T11:03:22.734Z","avatar_url":"https://github.com/preaction.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"NAME\n    Beam::Runner - Task runner and Map-Reduce framework for Beam\n\nVERSION\n    version 0.001\n\nSYNOPSIS\n        # Job is a series of Steps\n        # Steps accepts input (arguments) to become a Task\n        # Task is the intersection of Step and its arguments\n\n        # Run a job locally\n        my $job = Beam::Blast::Job-\u003enew(\n            wire =\u003e $wire,\n            steps =\u003e [\n                {\n                    ref =\u003e 'foo',\n                    method =\u003e 'bar',\n                },\n                {\n                    ref =\u003e 'baz',\n                    method =\u003e 'fuzz',\n                    args =\u003e [], # Don't pass the output from the prior task\n                },\n                {\n                    ref =\u003e 'fizz',\n                    method =\u003e 'buzz',\n                    args =\u003e [ 'moo', { '$ref': '@_' } ], # Append the output vars (curry)\n                },\n            ],\n        );\n\n        my ( $output_1, $output_2 ) = $job-\u003erun( $input_1, $input_2 );\n\n        # Run using the distributed workers\n        my $runner = Beam::Blast::Runner-\u003enew(\n            host =\u003e 'localhost',\n            port =\u003e 2132,\n        );\n        my $job = $runner-\u003ejob(\n            wire =\u003e $wire,\n            steps =\u003e [\n                {\n                    ref =\u003e 'foo',\n                    method =\u003e 'bar',\n                },\n                {\n                    ref =\u003e 'baz',\n                    method =\u003e 'fuzz',\n                },\n            ],\n        );\n        my ( $output_1, $output_2 ) = $job-\u003erun( $input_1, $input_2 );\n\n        # Run distributed and async\n        my @output;\n        my $cb = sub {\n            my ( $job, $output ) = @_;\n            push @output, $output;\n        };\n        $job-\u003erun( $input_1, $input_2, $cb );\n\n        # Run a worker\n        my $worker = Beam::Blast::Worker-\u003enew(\n            port =\u003e 2132,\n        );\n        $worker-\u003estart;\n\n        # Run a master\n        # Masters can run map-reduce jobs, parcelling out work to other workers\n        # Otherwise, they appear from the outside to be workers\n        my $master = Beam::Blast::Master-\u003enew(\n            port =\u003e 2132,\n            workers =\u003e 10,          # fork 10 child workers why not?\n        );\n        my $job = $master-\u003ejob( ... );\n        my @output = $job-\u003erun( 1..500 ); # Run all 500 tasks\n\n        # Connect any random worker to a master\n        Beam::Blast::Worker-\u003enew(\n            master =\u003e 'tcp://example.com:2132',\n            workers =\u003e 10,          # fork 10 more child workers\n        );\n        # When connected to a master, we don't need to accept any random job by\n        # opening a port. But we can, and then we would transmit our status\n        # to the master\n\n        # If you want to build a status monitor, you can use the Master's event\n        # callbacks\n\nDESCRIPTION\nAUTHOR\n    Doug Bell \u003cpreaction@cpan.org\u003e\n\nCOPYRIGHT AND LICENSE\n    This software is copyright (c) 2015 by Doug Bell.\n\n    This is free software; you can redistribute it and/or modify it under\n    the same terms as the Perl 5 programming language system itself.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreaction%2Fbeam-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpreaction%2Fbeam-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreaction%2Fbeam-worker/lists"}