{"id":19168399,"url":"https://github.com/bloomberg/net-amqp-connectionmgr","last_synced_at":"2025-05-07T14:41:40.840Z","repository":{"id":66125194,"uuid":"51873260","full_name":"bloomberg/Net-AMQP-ConnectionMgr","owner":"bloomberg","description":null,"archived":false,"fork":false,"pushed_at":"2016-02-16T21:57:24.000Z","size":5,"stargazers_count":3,"open_issues_count":0,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T23:31:58.714Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bloomberg.png","metadata":{"files":{"readme":"README","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":"2016-02-16T21:54:23.000Z","updated_at":"2024-08-12T19:15:40.000Z","dependencies_parsed_at":"2023-05-03T02:18:11.354Z","dependency_job_id":null,"html_url":"https://github.com/bloomberg/Net-AMQP-ConnectionMgr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloomberg%2FNet-AMQP-ConnectionMgr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloomberg%2FNet-AMQP-ConnectionMgr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloomberg%2FNet-AMQP-ConnectionMgr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloomberg%2FNet-AMQP-ConnectionMgr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bloomberg","download_url":"https://codeload.github.com/bloomberg/Net-AMQP-ConnectionMgr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252897398,"owners_count":21821432,"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-11-09T09:42:31.038Z","updated_at":"2025-05-07T14:41:40.809Z","avatar_url":"https://github.com/bloomberg.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"NAME\n    Net::AMQP::ConnectionMgr - Manages a AMQP connection\n\nSYNOPSIS\n      my $cmgr = Net::AMQP::ConnectionMgr-\u003enew('localhost', { });\n      my $channel = $cmgr-\u003edeclare_channel\n        (sub {\n            my ($rmq, $channel) = @_;\n            my %exchange_options =\n              ( exchange_type =\u003e 'topic',\n                passive       =\u003e 0,\n                durable       =\u003e 1,\n                auto_delete   =\u003e 0,\n              );\n            $rmq-\u003eexchange_declare\n              ($channel, $exchange_name,\n               \\%exchange_options, {});\n        });\n      $cmgr-\u003ewith_connection_do\n        (sub {\n           my $rmq = shift;\n           $rmq-\u003epublish($channel, $routing_key, $body,\n                         \\%message_options,\n                         \\%message_props)\n         });\n\nDESCRIPTION\n    Usage of rabbitmq has two common expectations from the application\n    developer:\n\n    *   The connection is subject to being closed from the server at any\n        point, and the application should handle that disconnect gracefully.\n\n    *   The applications should always declare the resources they use for\n        every connection.\n\n    Complying to that expectation using only Net::AMQP::RabbitMQ is very\n    error-prone. This modules provides a simple way of handling it.\n\nMETHODS\n    new($hostname, $options, $conn_class = Net::AMQP::RabbitMQ)\n        Initialize the object with the options. Does not necessarily start\n        the connection right away, but will transparently connect when\n        needed. The arguments to new are the same arguments for\n        Net::AMQP::RabbitMQ-\u003econnect.\n\n        The last argument is to allow you to dependency-inject a different\n        implementation for testing purposes or for using an alternative\n        implmentation.\n\n    with_connection_do($code, $retry = 1)\n        This will wrap the given coderef and execute it with the connection\n        as the first argument. This will also run the code within an eval\n        and catch rabbitmq errors and will automatically re-connect and\n        re-execute the code if the code dies.\n\n        The code, however, will only try that as many times as $retry_count\n        (which defaults to 1).\n\n        Note: This function doesn't pass any extra arguments. The point of\n        it is that you should use a closure to access any other data that\n        you need.\n\n    declare_channel($init_code)\n        Returns a new channel number in the rabbitmq connection.\n\n        It will call channel_open for you.\n\n        The argument is a code ref to additional setup that is necessary for\n        this channel, such as \"consume\" requests.\n\n        If the connection is open, the init_code will be executed right\n        away. Otherwise it will be deferred to when the connection is\n        actually established.\n\n        The init_code ref will be called again in case there is a\n        re-connect.\n\n        The arguments to the coderef will be the connection and the channel\n        number.\n\n    declare_resource($init_code)\n        Adds a resource declaration to this connection.\n\n        If the connection is open, the init_code will be executed right\n        away. Otherwise it will be deferred to when the connection is\n        actually established.\n\n        The init_code ref will be called again in case there is a\n        re-connect.\n\n        The arguments to the coderef will be the connection and the channel\n        number.\n\nCOPYRIGHT\n    Copyright 2016 Bloomberg Finance L.P.\n\n    Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n    not use this file except in compliance with the License. You may obtain\n    a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbloomberg%2Fnet-amqp-connectionmgr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbloomberg%2Fnet-amqp-connectionmgr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbloomberg%2Fnet-amqp-connectionmgr/lists"}