Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blocking Connection: allow sequence of parameters #8

Merged
merged 1 commit into from
Jan 16, 2022
Merged

Conversation

baodrate
Copy link
Owner

pika's blocking connection adapter allows for a sequence of parameters, not just a single one

https://github.com/pika/pika/blob/12dcdf15d0932c388790e0fa990810bfd21b1a32/pika/adapters/blocking_connection.py#L322-L329

class BlockingConnection(object):
    ...
    def __init__(self, parameters=None, _impl_class=None):
        """Create a new instance of the Connection object.

        :param None | pika.connection.Parameters | sequence parameters:
            Connection parameters instance or non-empty sequence of them. If
            None, a `pika.connection.Parameters` instance will be created with
            default settings. See `pika.AMQPConnectionWorkflow` for more
            details about multiple parameter configurations and retries.

https://github.com/pika/pika/blob/12dcdf15d0932c388790e0fa990810bfd21b1a32/pika/adapters/blocking_connection.py#L403-L420

    def _create_connection(self, configs, impl_class):
        """Run connection workflow, blocking until it completes.

        :param None | pika.connection.Parameters | sequence configs: Connection
            parameters instance or non-empty sequence of them.
        :param None | SelectConnection impl_class: for tests/debugging only;
            implementation class;

        :rtype: impl_class

        :raises: exception on failure
        """


        if configs is None:
            configs = (pika.connection.Parameters(),)


        if isinstance(configs, pika.connection.Parameters):
            configs = (configs,)

Closes #5

@baodrate baodrate merged commit c59e18c into main Jan 16, 2022
@baodrate baodrate deleted the connection branch January 16, 2022 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incomplete type for BlockingConnection adapter __init__ parameters
1 participant