{"id":20098836,"url":"https://github.com/mark-5/p5-broker-async","last_synced_at":"2026-06-01T01:31:51.218Z","repository":{"id":56836667,"uuid":"71964662","full_name":"mark-5/p5-broker-async","owner":"mark-5","description":"Broker tasks for multiple workers","archived":false,"fork":false,"pushed_at":"2017-08-14T00:57:11.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-02T16:48:19.045Z","etag":null,"topics":["perl"],"latest_commit_sha":null,"homepage":"https://metacpan.org/pod/Broker::Async","language":"Perl","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/mark-5.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","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":"2016-10-26T03:56:03.000Z","updated_at":"2017-02-15T05:05:36.000Z","dependencies_parsed_at":"2022-09-01T13:12:27.542Z","dependency_job_id":null,"html_url":"https://github.com/mark-5/p5-broker-async","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/mark-5/p5-broker-async","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-5%2Fp5-broker-async","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-5%2Fp5-broker-async/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-5%2Fp5-broker-async/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-5%2Fp5-broker-async/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mark-5","download_url":"https://codeload.github.com/mark-5/p5-broker-async/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-5%2Fp5-broker-async/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33756575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"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":["perl"],"created_at":"2024-11-13T17:06:52.305Z","updated_at":"2026-06-01T01:31:50.696Z","avatar_url":"https://github.com/mark-5.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nBroker::Async - broker tasks for multiple workers\n\n\u003cdiv\u003e\n    \u003ca href=\"https://travis-ci.org/mark-5/p5-broker-async\"\u003e\u003cimg src=\"https://travis-ci.org/mark-5/p5-broker-async.svg?branch=master\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n# SYNOPSIS\n\n    my @workers;\n    for my $uri (@uris) {\n        my $client = SomeClient-\u003enew($uri);\n        push @workers, sub { $client-\u003erequest(@_) };\n    }\n\n    my $broker = Broker::Async-\u003enew(@workers);\n    for my $future (map $broker-\u003edo($_), @requests) {\n        my $result = $future-\u003eget;\n        ...\n    }\n\n# DESCRIPTION\n\nThis module brokers tasks for multiple asynchronous workers. A worker can be any code reference that returns a [Future](https://metacpan.org/pod/Future), representing work awaiting completion.\n\nSome common use cases include throttling asynchronous requests to a server, or delegating tasks to a limited number of processes.\n\n# METHODS\n\n## new\n\n    my @args   = ( sub { ... }, ... );\n    my $broker = Broker::Async-\u003enew(@args);\n\n@args must be an array of workers used for handling tasks.\nCan be a code reference, a hash ref of [Broker::Async::Worker](https://metacpan.org/pod/Broker::Async::Worker) arguments, or a [Broker::Async::Worker](https://metacpan.org/pod/Broker::Async::Worker) object.\nEvery invocation of a worker must return a [Future](https://metacpan.org/pod/Future) object.\n\nUnder the hood, code and hash references are simply used to instantiate a [Broker::Async::Worker](https://metacpan.org/pod/Broker::Async::Worker) object.\nSee [Broker::Async::Worker](https://metacpan.org/pod/Broker::Async::Worker) for more documentation about how these parameters are used.\n\n## do\n\n    my $future = $broker-\u003edo(@args);\n\nQueue the invocation of a worker with @args.\n@args can be any data structure, and is passed as is to a worker code ref.\nReturns a [Future](https://metacpan.org/pod/Future) object that resolves when the work is done.\n\nThere is no guarantee when a worker will be called, that depends on when a worker becomes available.\nHowever, calls are guaranteed to be invoked in the order they are seen by $broker-\u003edo.\n\n# AUTHOR\n\nMark Flickinger \u003cmaf@cpan.org\u003e\n\n# LICENSE\n\nThis software is licensed under the same terms as Perl itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmark-5%2Fp5-broker-async","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmark-5%2Fp5-broker-async","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmark-5%2Fp5-broker-async/lists"}