{"id":18284480,"url":"https://github.com/pplu/paws-net-multiplexcaller","last_synced_at":"2026-05-19T07:05:41.333Z","repository":{"id":56838947,"uuid":"98201428","full_name":"pplu/paws-net-multiplexcaller","owner":"pplu","description":"Paws::Net::MultiplexCaller - Control routing of services to Paws callers","archived":false,"fork":false,"pushed_at":"2019-07-11T09:16:11.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-15T00:25:55.217Z","etag":null,"topics":["aws","paws","paws-callers","pluggable-callers","testing"],"latest_commit_sha":null,"homepage":null,"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/pplu.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":"2017-07-24T14:43:43.000Z","updated_at":"2019-07-11T09:16:13.000Z","dependencies_parsed_at":"2022-08-28T23:12:38.224Z","dependency_job_id":null,"html_url":"https://github.com/pplu/paws-net-multiplexcaller","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pplu%2Fpaws-net-multiplexcaller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pplu%2Fpaws-net-multiplexcaller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pplu%2Fpaws-net-multiplexcaller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pplu%2Fpaws-net-multiplexcaller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pplu","download_url":"https://codeload.github.com/pplu/paws-net-multiplexcaller/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247987107,"owners_count":21028891,"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":["aws","paws","paws-callers","pluggable-callers","testing"],"created_at":"2024-11-05T13:13:41.087Z","updated_at":"2025-10-19T03:38:49.987Z","avatar_url":"https://github.com/pplu.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nPaws::Net::MultiplexCaller - Control routing of services to Paws callers\n\n# SYNOPSIS\n\n    use Paws::Net::MultiplexCaller;\n    use Paws::Net::LWPCaller;\n    use Paws::Net::MockCaller;\n\n    my $paws = Paws-\u003enew(\n      config =\u003e {\n        caller =\u003e Paws::Net::MultiplexCaller-\u003enew(\n          caller_for =\u003e {\n            SQS =\u003e Paws::Net::LWPCaller-\u003enew(),\n            EC2 =\u003e Paws::Net::MockCaller-\u003enew(...),\n          },\n          default_caller =\u003e Paws::Net::Caller-\u003enew\n        )\n      }\n    );\n\n    # SQS methods will be called with LWPCaller\n    # $paws-\u003eservice('SQS', region =\u003e 'eu-west-1')-\u003eCreateQueue\n    # EC2 with the MockCaller\n    # $paws-\u003eservice('EC2', region =\u003e 'us-east-1')-\u003eRunInstances\n    # others will be called with the default Paws::Net::Caller\n    # $paws-\u003eservice('DynamoDB', region =\u003e 'us-east-1')-\u003eCreateTable \n\n# DESCRIPTION\n\nBy default, Paws routes all calls to service methods (RunInstances for EC2 and CreateQueue for SQS, for example) to the configured caller (that normally will do HTTP requests to the backing services). All calls go to the one and only caller.\n\nPaws::Net::MultiplexCaller is one of Paws' pluggable callers whose only purpose is to let you route requests to different callers. So you can do special things like:\n\n- Use a special caller for just one service\n- Emulate services without doing HTTP calls\n\n# ATTRIBUTES\n\nAttributes are initialized in the constructor\n\n## caller\\_for\n\nIs a Hashref which keys are the names of the services to route for. It's values are instances of objects that can handle Paws calls (it's pluggable callers). Note that you can pass the same object for different services\n\n    my $caller2 = Paws::Net::LWPCaller-\u003enew;\n    my $paws = Paws-\u003enew(\n      config =\u003e {\n        caller =\u003e Paws::Net::MultiplexCaller-\u003enew(\n          caller_for =\u003e {\n            SQS =\u003e $caller2,\n            EC2 =\u003e $caller2,\n          },\n        )\n      }\n    );\n\nAs opposed to\n\n    my $paws = Paws-\u003enew(\n      config =\u003e {\n        caller =\u003e Paws::Net::MultiplexCaller-\u003enew(\n          caller_for =\u003e {\n            SQS =\u003e Paws::Net::LWPCaller-\u003enew,\n            EC2 =\u003e Paws::Net::LWPCaller-\u003enew,\n          },\n        )\n      }\n    );\n\nWhere there would be two independant instances of LWPCaller (consuming double memory), or leading\nto unexpected results (should the callers track some sort of state, like [Paw::Net::MockCaller](https://metacpan.org/pod/Paw::Net::MockCaller))\n\n## default\\_caller\n\nIf not specified, any call to a service that is not in `caller_for` will fail to complete, raising\nan exception.\n\nIf specified, Paws will route any service that is not in `caller_for` to this caller, that should\nbe initialized to an instance of any of Paws' pluggable callers.\n\n# Practical use\n\nOn CPAN you can find [Paws::Kinesis::MemoryCaller](https://metacpan.org/pod/Paws::Kinesis::MemoryCaller), that emulates the AWS Kinesis service. Using\nthat caller will not let you call other AWS services. With `Paws::Net::MultiplexCaller` we can\nsolve that:\n\n    my $paws = Paws-\u003enew(\n      config =\u003e {\n        caller =\u003e Paws::Net::MultiplexCaller-\u003enew(\n          caller_for =\u003e {\n            Kinesis =\u003e Paws::Kinesis::MemoryCaller-\u003enew(),\n          },\n          default_caller =\u003e Paws::Net::Caller-\u003enew\n        )\n      }\n    );\n\nYou can also combine the multiplex caller with [PawsX::FakeImplementation::Instance](https://metacpan.org/pod/PawsX::FakeImplementation::Instance) to easily\nfake some AWS services for your testing purposes.\n\n# AUTHOR\n\n    Jose Luis Martinez\n    CPAN ID: JLMARTIN\n    CAPSiDE\n    jlmartinez@capside.com\n\n# SEE ALSO\n\n[Paws](https://metacpan.org/pod/Paws)\n\n[Paws::Kinesis::MemoryCaller](https://metacpan.org/pod/Paws::Kinesis::MemoryCaller)\n\n[PawsX::FakeImplementation::Instance](https://metacpan.org/pod/PawsX::FakeImplementation::Instance)\n\n# BUGS and SOURCE\n\nThe source code is located here: [https://github.com/pplu/paws-net-multiplexcaller](https://github.com/pplu/paws-net-multiplexcaller)\n\nPlease report bugs to: [https://github.com/pplu/paws-net-multiplexcaller/issues](https://github.com/pplu/paws-net-multiplexcaller/issues)\n\n# COPYRIGHT and LICENSE\n\nCopyright (c) 2017 by CAPSiDE\n\nThis code is distributed under the Apache 2 License. The full text of the license can be found in the LICENSE file included with this module.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpplu%2Fpaws-net-multiplexcaller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpplu%2Fpaws-net-multiplexcaller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpplu%2Fpaws-net-multiplexcaller/lists"}