pika API Reference
Full documentation for pika (1.4.2)
pika.AMQPConnectionWorkflow
Python Library Documentation: class AMQPConnectionWorkflow in module pika.adapters.utils.connection_workflow class AMQPConnectionWorkflow(AbstractAMQPConnectionWorkflow) | AMQPConnectionWorkflow(_until_first_amqp_attempt: 'bool' = False) -> 'None' | | Implements Pika's default workflow for performing multiple TCP/[SSL]/AMQP | connection attempts with timeouts and retries until one succeeds or all | attempts fail. | | The workflow: | while not success and retries remain: | 1. For each given config (pika.connection.Parameters object): | A. Perform DNS resolution of the config's host. | B. Attempt to establish TCP/[SSL]/AMQP for each resolved address | until one succeeds, in which case we're done. | 2. If all configs failed but retries remain, resume from beginning | after the given retry pause. NOTE: failure of DNS resolution | is equivalent to one cycle and will be retried after the pause | if retries remain. | | Method resolution order: | AMQPConnectionWorkflow | AbstractAMQPConnectionWorkflow | abc.AbstractBase | builtins.object | | Methods defined here: | | __init__(self, _until_first_amqp_attempt: 'bool' = False) -> 'None' | :param int | float retry_pause: Non-negative number of seconds to wait | before retrying the config sequence. Meaningful only if retries is | greater than 0. Defaults to 2 seconds. | :param bool _until_first_amqp_attempt: INTERNAL USE ONLY; ends workflow | after first AMQP handshake attempt, regardless of outcome (success | or failure). The automatic connection logic in | `pika.connection.Connection` enables this because it's not | designed/tested to reset all state properly to handle more than one | AMQP handshake attempt. | | TODO: Do we need getaddrinfo timeout? | TODO: Would it be useful to implement exponential back-off? | | abort(self) -> 'None' | Override `AbstractAMQPConnectionWorkflow.abort()`. | | set_io_services(self, nbio: 'nbio_interface.AbstractIOServices') -> 'None' | Called by the conneciton adapter only on pika's | `AMQPConnectionWorkflow` instance to provide it the adapter-specific | `AbstractIOServices` object before calling the `start()` method. | | NOTE: Custom workflow implementations should use the native I/O loop | directly because `AbstractIOServices` is private to Pika | implementation and its interface may change without notice. | | :param pika.adapters.utils.nbio_interface.AbstractIOServices nbio: | | start(self, connection_configs: 'Sequence[pika.connection.Parameters]', connector_factory: 'Callable[..., Any]', native_loop, on_done: 'Callable[[Union[pika.connection.Connection, AMQPConnectorException]], None]') -> 'None' | Override `AbstractAMQPConnectionWorkflow.start()`. | | NOTE: This implementation uses `connection_attempts` and `retry_delay` | values from the last element of the given `connection_configs` sequence | as the overall number of connection attempts of the entire | `connection_configs` sequence and pause between each sequence. | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | __abstractmethods__ = frozenset() | | ---------------------------------------------------------------------- | Data descriptors inherited from abc.AbstractBase: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
pika.BaseConnection
Python Library Documentation: class BaseConnection in module pika.adapters.base_connection
class BaseConnection(pika.connection.Connection)
| BaseConnection(parameters: 'Optional[connection.Parameters]', on_open_callback: 'Optional[Callable[[connection.Connection], None]]', on_open_error_callback: 'Optional[Callable[[connection.Connection, BaseException], None]]', on_close_callback: 'Optional[Callable[[connection.Connection, BaseException], None]]', nbio: 'nbio_interface.AbstractIOServices', internal_connection_workflow: 'bool' = True) -> 'None'
|
| BaseConnection class that should be extended by connection adapters.
|
| This class abstracts I/O loop and transport services from pika core.
|
| Method resolution order:
| BaseConnection
| pika.connection.Connection
| abc.AbstractBase
| builtins.object
|
| Methods defined here:
|
| __init__(self, parameters: 'Optional[connection.Parameters]', on_open_callback: 'Optional[Callable[[connection.Connection], None]]', on_open_error_callback: 'Optional[Callable[[connection.Connection, BaseException], None]]', on_close_callback: 'Optional[Callable[[connection.Connection, BaseException], None]]', nbio: 'nbio_interface.AbstractIOServices', internal_connection_workflow: 'bool' = True) -> 'None'
| Create a new instance of the Connection object.
|
| :param None|pika.connection.Parameters parameters: Connection parameters
| :param None|method on_open_callback: Method to call on connection open
| :param None | method on_open_error_callback: Called if the connection
| can't be established or connection establishment is interrupted by
| `Connection.close()`: on_open_error_callback(Connection, exception).
| :param None | method on_close_callback: Called when a previously fully
| open connection is closed:
| `on_close_callback(Connection, exception)`, where `exception` is
| either an instance of `exceptions.ConnectionClosed` if closed by
| user or broker or exception of another type that describes the cause
| of connection failure.
| :param pika.adapters.utils.nbio_interface.AbstractIOServices nbio:
| asynchronous services
| :param bool internal_connection_workflow: True for autonomous connection
| establishment which is default; False for externally-managed
| connection workflow via the `create_connection()` factory.
| :raises: RuntimeError
| :raises: ValueError
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| create_connection(connection_configs: 'Sequence[connection.Parameters]', on_done: 'Callable[[Union[connection.Connection, connection_workflow.AMQPConnectorException]], None]', custom_ioloop: 'Optional[Any]' = None, workflow: 'Optional[connection_workflow.AbstractAMQPConnectionWorkflow]' = None) -> 'connection_workflow.AbstractAMQPConnectionWorkflow'
| Asynchronously create a connection to an AMQP broker using the given
| configurations. Will attempt to connect using each config in the given
| order, including all compatible resolved IP addresses of the hostname
| supplied in each config, until one is established or all attempts fail.
|
| See also `_start_connection_workflow()`.
|
| :param sequence connection_configs: A sequence of one or more
| `pika.connection.Parameters`-based objects.
| :param callable on_done: as defined in
| `connection_workflow.AbstractAMQPConnectionWorkflow.start()`.
| :param object | None custom_ioloop: Provide a custom I/O loop that is
| native to the specific adapter implementation; if None, the adapter
| will use a default loop instance, which is typically a singleton.
| :param connection_workflow.AbstractAMQPConnectionWorkflow | None workflow:
| Pass an instance of an implementation of the
| `connection_workflow.AbstractAMQPConnectionWorkflow` interface;
| defaults to a `connection_workflow.AMQPConnectionWorkflow` instance
| with default values for optional args.
| :returns: Connection workflow instance in use. The user should limit
| their interaction with this object only to it's `abort()` method.
| :rtype: connection_workflow.AbstractAMQPConnectionWorkflow
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| ioloop
| :returns: the native I/O loop instance underlying async services selected
| by user or the default selected by the specialized connection
| adapter (e.g., Twisted reactor, `asyncio.SelectorEventLoop`,
| `select_connection.IOLoop`, etc.)
| :rtype: object
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __abstractmethods__ = frozenset({'create_connection'})
|
| ----------------------------------------------------------------------
| Methods inherited from pika.connection.Connection:
|
| add_on_close_callback(self, callback: 'Callable[[Connection, Exception], Any]') -> 'None'
| Add a callback notification when the connection has closed. The
| callback will be passed the connection and an exception instance. The
| exception will either be an instance of `exceptions.ConnectionClosed` if
| a fully-open connection was closed by user or broker or exception of
| another type that describes the cause of connection closure/failure.
|
| :param callable callback: Callback to call on close, having the signature:
| callback(pika.connection.Connection, exception)
|
| add_on_connection_blocked_callback(self, callback: 'Callable[[Connection, frame.Method[spec.Connection.Blocked]], Any]') -> 'None'
| RabbitMQ AMQP extension - Add a callback to be notified when the
| connection gets blocked (`Connection.Blocked` received from RabbitMQ)
| due to the broker running low on resources (memory or disk). In this
| state RabbitMQ suspends processing incoming data until the connection
| is unblocked, so it's a good idea for publishers receiving this
| notification to suspend publishing until the connection becomes
| unblocked.
|
| See also `Connection.add_on_connection_unblocked_callback()`
|
| See also `ConnectionParameters.blocked_connection_timeout`.
|
| :param callable callback: Callback to call on `Connection.Blocked`,
| having the signature `callback(connection, pika.frame.Method)`,
| where the method frame's `method` member is of type
| `pika.spec.Connection.Blocked`
|
| add_on_connection_unblocked_callback(self, callback: 'Callable[[Connection, frame.Method[spec.Connection.Unblocked]], Any]') -> 'None'
| RabbitMQ AMQP extension - Add a callback to be notified when the
| connection gets unblocked (`Connection.Unblocked` frame is received from
| RabbitMQ) letting publishers know it's ok to start publishing again.
|
| :param callable callback: Callback to call on
| `Connection.Unblocked`, having the signature
| `callback(connection, pika.frame.Method)`, where the method frame's
| `method` member is of type `pika.spec.Connection.Unblocked`
|
| add_on_open_callback(self, callback: 'Callable[[Connection], Any]') -> 'None'
| Add a callback notification when the connection has opened. The
| callback will be passed the connection instance as its only arg.
|
| :param callable callback: Callback to call when open
|
| add_on_open_error_callback(self, callback: 'Callable[[Connection, Optional[BaseException]], Any]', remove_default: 'bool' = True) -> 'None'
| Add a callback notification when the connection can not be opened.
|
| The callback method should accept the connection instance that could not
| connect, and either a string or an exception as its second arg.
|
| :param callable callback: Callback to call when can't connect, having
| the signature _(Connection, Exception)
| :param bool remove_default: Remove default exception raising callback
|
| channel(self, channel_number: 'Optional[int]' = None, on_open_callback: 'Optional[Callable[[Channel], Any]]' = None) -> 'Channel'
| Create a new channel with the next available channel number or pass
| in a channel number to use. Must be non-zero if you would like to
| specify but it is recommended that you let Pika manage the channel
| numbers.
|
| :param int channel_number: The channel number to use, defaults to the
| next available.
| :param callable on_open_callback: The callback when the channel is
| opened. The callback will be invoked with the `Channel` instance
| as its only argument.
| :rtype: pika.channel.Channel
|
| close(self, reply_code: 'int' = 200, reply_text: 'str' = 'Normal shutdown') -> 'None'
| Disconnect from RabbitMQ. If there are any open channels, it will
| attempt to close them prior to fully disconnecting. Channels which
| have active consumers will attempt to send a Basic.Cancel to RabbitMQ
| to cleanly stop the delivery of messages prior to closing the channel.
|
| :param int reply_code: The code number for the close
| :param str reply_text: The text reason for the close
|
| :raises pika.exceptions.ConnectionWrongStateError: if connection is
| closed or closing.
|
| update_secret(self, new_secret: 'str', reason: 'str', callback: 'Optional[Callable[[frame.Method[spec.Connection.UpdateSecretOk]], Any]]' = None) -> 'None'
| RabbitMQ AMQP extension - This method updates the secret used to authenticate this connection.
| It is used when secrets have an expiration date and need to be renewed, like OAuth 2 tokens.
| Pass a callback to be notified of the response from the server.
|
| :param string new_secret: The new secret
| :param string reason: The reason for the secret update
| :param callable callback: Callback to call on
| `Connection.UpdateSecretOk`, having the signature
| `callback(pika.frame.Method)`, where the method frame's
| `method` member is of type `pika.spec.Connection.UpdateSecretOk`
|
| :raises pika.exceptions.ConnectionWrongStateError: if connection is
| not open.
|
| ----------------------------------------------------------------------
| Readonly properties inherited from pika.connection.Connection:
|
| basic_nack
| Specifies if the server supports basic.nack on the active connection.
|
| :rtype: bool
|
| consumer_cancel_notify
| Specifies if the server supports consumer cancel notification on the
| active connection.
|
| :rtype: bool
|
| exchange_exchange_bindings
| Specifies if the active connection supports exchange to exchange
| bindings.
|
| :rtype: bool
|
| is_closed
| Returns a boolean reporting the current connection state.
|
| is_closing
| Returns True if connection is in the process of closing due to
| client-initiated `close` request, but closing is not yet complete.
|
| is_open
| Returns a boolean reporting the current connection state.
|
| publisher_confirms
| Specifies if the active connection can use publisher confirmations.
|
| :rtype: bool
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from pika.connection.Connection:
|
| CONNECTION_CLOSED = 0
|
| CONNECTION_CLOSING = 6
|
| CONNECTION_INIT = 1
|
| CONNECTION_OPEN = 5
|
| CONNECTION_PROTOCOL = 2
|
| CONNECTION_START = 3
|
| CONNECTION_TUNE = 4
|
| ON_CONNECTION_CLOSED = '_on_connection_closed'
|
| ON_CONNECTION_ERROR = '_on_connection_error'
|
| ON_CONNECTION_OPEN_OK = '_on_connection_open_ok'
|
| ----------------------------------------------------------------------
| Data descriptors inherited from abc.AbstractBase:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
pika.BasicProperties
Python Library Documentation: class BasicProperties in module pika.spec
class BasicProperties(pika.amqp_object.Properties)
| BasicProperties(content_type=None, content_encoding=None, headers=None, delivery_mode=None, priority=None, correlation_id=None, reply_to=None, expiration=None, message_id=None, timestamp=None, type=None, user_id=None, app_id=None, cluster_id=None)
|
| Method resolution order:
| BasicProperties
| pika.amqp_object.Properties
| pika.amqp_object.AMQPObject
| builtins.object
|
| Methods defined here:
|
| __init__(self, content_type=None, content_encoding=None, headers=None, delivery_mode=None, priority=None, correlation_id=None, reply_to=None, expiration=None, message_id=None, timestamp=None, type=None, user_id=None, app_id=None, cluster_id=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| decode(self, encoded, offset=0)
|
| encode(self)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| CLASS = <class 'pika.spec.Basic'>
|
| FLAG_APP_ID = 8
|
| FLAG_CLUSTER_ID = 4
|
| FLAG_CONTENT_ENCODING = 16384
|
| FLAG_CONTENT_TYPE = 32768
|
| FLAG_CORRELATION_ID = 1024
|
| FLAG_DELIVERY_MODE = 4096
|
| FLAG_EXPIRATION = 256
|
| FLAG_HEADERS = 8192
|
| FLAG_MESSAGE_ID = 128
|
| FLAG_PRIORITY = 2048
|
| FLAG_REPLY_TO = 512
|
| FLAG_TIMESTAMP = 64
|
| FLAG_TYPE = 32
|
| FLAG_USER_ID = 16
|
| INDEX = 60
|
| NAME = 'BasicProperties'
|
| __annotations__ = {}
|
| ----------------------------------------------------------------------
| Methods inherited from pika.amqp_object.AMQPObject:
|
| __eq__(self, other: 'object') -> 'bool'
| Return self==value.
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pika.amqp_object.AMQPObject:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from pika.amqp_object.AMQPObject:
|
| __hash__ = None
pika.BlockingConnection
Python Library Documentation: class BlockingConnection in module pika.adapters.blocking_connection class BlockingConnection(builtins.object) | BlockingConnection(parameters: 'Optional[Union[pika.connection.Parameters, Sequence[pika.connection.Parameters]]]' = None, _impl_class: 'Optional[select_connection.SelectConnection]' = None) -> 'None' | | The BlockingConnection creates a layer on top of Pika's asynchronous core | providing methods that will block until their expected response has | returned. Due to the asynchronous nature of the `Basic.Deliver` and | `Basic.Return` calls from RabbitMQ to your application, you can still | implement continuation-passing style asynchronous methods if you'd like to | receive messages from RabbitMQ using | :meth:`basic_consume <BlockingChannel.basic_consume>` or if you want to be | notified of a delivery failure when using | :meth:`basic_publish <BlockingChannel.basic_publish>`. | | For more information about communicating with the blocking_connection | adapter, be sure to check out the | :class:`BlockingChannel <BlockingChannel>` class which implements the | :class:`Channel <pika.channel.Channel>` based communication for the | blocking_connection adapter. | | To prevent recursion/reentrancy, the blocking connection and channel | implementations queue asynchronously-delivered events received | in nested context (e.g., while waiting for `BlockingConnection.channel` or | `BlockingChannel.queue_declare` to complete), dispatching them synchronously | once nesting returns to the desired context. This concerns all callbacks, | such as those registered via `BlockingConnection.call_later`, | `BlockingConnection.add_on_connection_blocked_callback`, | `BlockingConnection.add_on_connection_unblocked_callback`, | `BlockingChannel.basic_consume`, etc. | | Blocked Connection deadlock avoidance: when RabbitMQ becomes low on | resources, it emits Connection.Blocked (AMQP extension) to the client | connection when client makes a resource-consuming request on that connection | or its channel (e.g., `Basic.Publish`); subsequently, RabbitMQ suspsends | processing requests from that connection until the affected resources are | restored. See https://www.rabbitmq.com/connection-blocked.html. This | may impact `BlockingConnection` and `BlockingChannel` operations in a | way that users might not be expecting. For example, if the user dispatches | `BlockingChannel.basic_publish` in non-publisher-confirmation mode while | RabbitMQ is in this low-resource state followed by a synchronous request | (e.g., `BlockingConnection.channel`, `BlockingChannel.consume`, | `BlockingChannel.basic_consume`, etc.), the synchronous request will block | indefinitely (until Connection.Unblocked) waiting for RabbitMQ to reply. If | the blocked state persists for a long time, the blocking operation will | appear to hang. In this state, `BlockingConnection` instance and its | channels will not dispatch user callbacks. SOLUTION: To break this potential | deadlock, applications may configure the `blocked_connection_timeout` | connection parameter when instantiating `BlockingConnection`. Upon blocked | connection timeout, this adapter will raise ConnectionBlockedTimeout | exception`. See `pika.connection.ConnectionParameters` documentation to | learn more about the `blocked_connection_timeout` configuration. | | Methods defined here: | | __enter__(self) -> 'BlockingConnection' | | __exit__(self, exc_type: 'Exception', value: 'TracebackException', traceback: 'TracebackType') -> 'None' | | __init__(self, parameters: 'Optional[Union[pika.connection.Parameters, Sequence[pika.connection.Parameters]]]' = None, _impl_class: 'Optional[select_connection.SelectConnection]' = None) -> '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. | :param _impl_class: for tests/debugging only; implementation class; | None=default | | :raises RuntimeError: | | __repr__(self) -> 'str' | Return repr(self). | | add_callback_threadsafe(self, callback: 'Callable[..., None]') -> 'None' | Requests a call to the given function as soon as possible in the | context of this connection's thread. | | NOTE: This is the only thread-safe method in `BlockingConnection`. All | other manipulations of `BlockingConnection` must be performed from the | connection's thread. | | NOTE: the callbacks are dispatched only in the scope of | specially-designated methods: see | `BlockingConnection.process_data_events()` and | `BlockingChannel.start_consuming()`. | | For example, a thread may request a call to the | `BlockingChannel.basic_ack` method of a `BlockingConnection` that is | running in a different thread via:: | | connection.add_callback_threadsafe( | functools.partial(channel.basic_ack, delivery_tag=...)) | | NOTE: if you know that the requester is running on the same thread as | the connection it is more efficient to use the | `BlockingConnection.call_later()` method with a delay of 0. | | :param callable callback: The callback method; must be callable | :raises pika.exceptions.ConnectionWrongStateError: if connection is | closed | | add_on_connection_blocked_callback(self, callback: 'Callable[[pika.connection.Connection, pika.frame.Method[pika.spec.Connection.Blocked]], None]') -> 'None' | RabbitMQ AMQP extension - Add a callback to be notified when the | connection gets blocked (`Connection.Blocked` received from RabbitMQ) | due to the broker running low on resources (memory or disk). In this | state RabbitMQ suspends processing incoming data until the connection | is unblocked, so it's a good idea for publishers receiving this | notification to suspend publishing until the connection becomes | unblocked. | | NOTE: due to the blocking nature of BlockingConnection, if it's sending | outbound data while the connection is/becomes blocked, the call may | remain blocked until the connection becomes unblocked, if ever. You | may use `ConnectionParameters.blocked_connection_timeout` to abort a | BlockingConnection method call with an exception when the connection | remains blocked longer than the given timeout value. | | See also `Connection.add_on_connection_unblocked_callback()` | | See also `ConnectionParameters.blocked_connection_timeout`. | | :param callable callback: Callback to call on `Connection.Blocked`, | having the signature `callback(connection, pika.frame.Method)`, | where connection is the `BlockingConnection` instance and the method | frame's `method` member is of type `pika.spec.Connection.Blocked` | | add_on_connection_unblocked_callback(self, callback: 'Callable[[pika.connection.Connection, pika.frame.Method[pika.spec.Connection.Unblocked]], None]') -> 'None' | RabbitMQ AMQP extension - Add a callback to be notified when the | connection gets unblocked (`Connection.Unblocked` frame is received from | RabbitMQ) letting publishers know it's ok to start publishing again. | | :param callable callback: Callback to call on Connection.Unblocked`, | having the signature `callback(connection, pika.frame.Method)`, | where connection is the `BlockingConnection` instance and the method | frame's `method` member is of type `pika.spec.Connection.Unblocked` | | call_later(self, delay: 'float', callback: 'Callable[[], None]') -> 'int' | Create a single-shot timer to fire after delay seconds. Do not | confuse with Tornado's timeout where you pass in the time you want to | have your callback called. Only pass in the seconds until it's to be | called. | | NOTE: the timer callbacks are dispatched only in the scope of | specially-designated methods: see | `BlockingConnection.process_data_events()` and | `BlockingChannel.start_consuming()`. | | :param float delay: The number of seconds to wait to call callback | :param callable callback: The callback method with the signature | callback() | :returns: Opaque timer id | :rtype: int | | channel(self, channel_number: 'Optional[int]' = None) -> 'BlockingChannel' | Create a new channel with the next available channel number or pass | in a channel number to use. Must be non-zero if you would like to | specify but it is recommended that you let Pika manage the channel | numbers. | | :rtype: pika.adapters.blocking_connection.BlockingChannel | | close(self, reply_code: 'int' = 200, reply_text: 'str' = 'Normal shutdown') -> 'None' | Disconnect from RabbitMQ. If there are any open channels, it will | attempt to close them prior to fully disconnecting. Channels which | have active consumers will attempt to send a Basic.Cancel to RabbitMQ | to cleanly stop the delivery of messages prior to closing the channel. | | :param int reply_code: The code number for the close | :param str reply_text: The text reason for the close | | :raises pika.exceptions.ConnectionWrongStateError: if called on a closed | connection (NEW in v1.0.0) | | process_data_events(self, time_limit: 'Optional[float]' = 0) -> 'None' | Will make sure that data events are processed. Dispatches timer and | channel callbacks if not called from the scope of BlockingConnection or | BlockingChannel callback. Your app can block on this method. If your | application maintains a long-lived publisher connection, this method | should be called periodically in order to respond to heartbeats and other | data events. See `examples/long_running_publisher.py` for an example. | | :param float time_limit: suggested upper bound on processing time in | seconds. The actual blocking time depends on the granularity of the | underlying ioloop. Zero means return as soon as possible. None means | there is no limit on processing time and the function will block | until I/O produces actionable events. Defaults to 0 for backward | compatibility. This parameter is NEW in pika 0.10.0. | | remove_timeout(self, timeout_id: 'int') -> 'None' | Remove a timer if it's still in the timeout stack | | :param timeout_id: The opaque timer id to remove | | sleep(self, duration: 'float') -> 'None' | A safer way to sleep than calling time.sleep() directly that would | keep the adapter from ignoring frames sent from the broker. The | connection will "sleep" or block the number of seconds specified in | duration in small intervals. | | :param float duration: The time to sleep in seconds | | update_secret(self, new_secret: 'str', reason: 'str') -> 'None' | RabbitMQ AMQP extension - This method updates the secret used to authenticate this connection. | It is used when secrets have an expiration date and need to be renewed, like OAuth 2 tokens. | | :param string new_secret: The new secret | :param string reason: The reason for the secret update | | :raises pika.exceptions.ConnectionWrongStateError: if connection is | not open. | | ---------------------------------------------------------------------- | Readonly properties defined here: | | basic_nack | Specifies if the server supports basic.nack on the active connection. | | :rtype: bool | | basic_nack_supported | Specifies if the server supports basic.nack on the active connection. | | :rtype: bool | | consumer_cancel_notify | Specifies if the server supports consumer cancel notification on the | active connection. | | :rtype: bool | | consumer_cancel_notify_supported | Specifies if the server supports consumer cancel notification on the | active connection. | | :rtype: bool | | exchange_exchange_bindings | Specifies if the active connection supports exchange to exchange | bindings. | | :rtype: bool | | exchange_exchange_bindings_supported | Specifies if the active connection supports exchange to exchange | bindings. | | :rtype: bool | | is_closed | Returns a boolean reporting the current connection state. | | is_open | Returns a boolean reporting the current connection state. | | publisher_confirms | Specifies if the active connection can use publisher confirmations. | | :rtype: bool | | publisher_confirms_supported | Specifies if the active connection can use publisher confirmations. | | :rtype: bool | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
pika.ConnectionParameters
Python Library Documentation: class ConnectionParameters in module pika.connection class ConnectionParameters(Parameters) | ConnectionParameters(host: 'DefaultT[str]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, port: 'DefaultT[int]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, virtual_host: 'DefaultT[str]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, credentials: 'DefaultT[Union[pika.credentials.PlainCredentials, pika.credentials.ExternalCredentials]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, channel_max: 'DefaultT[int]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, frame_max: 'DefaultT[int]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, heartbeat: 'DefaultT[Optional[Union[int, Callable[[Connection, float], int]]]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, ssl_options: 'DefaultT[Optional[SSLOptions]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, connection_attempts: 'DefaultT[int]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, retry_delay: 'DefaultT[float]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, socket_timeout: 'DefaultT[Optional[float]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, stack_timeout: 'DefaultT[Optional[float]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, locale: 'DefaultT[str]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, blocked_connection_timeout: 'DefaultT[Optional[float]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, client_properties: 'DefaultT[Optional[Dict[str, Any]]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, tcp_options: 'DefaultT[Optional[Dict[str, Any]]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, **kwargs: 'Any') -> 'None' | | Connection parameters object that is passed into the connection adapter | upon construction. | | Method resolution order: | ConnectionParameters | Parameters | builtins.object | | Methods defined here: | | __init__(self, host: 'DefaultT[str]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, port: 'DefaultT[int]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, virtual_host: 'DefaultT[str]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, credentials: 'DefaultT[Union[pika.credentials.PlainCredentials, pika.credentials.ExternalCredentials]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, channel_max: 'DefaultT[int]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, frame_max: 'DefaultT[int]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, heartbeat: 'DefaultT[Optional[Union[int, Callable[[Connection, float], int]]]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, ssl_options: 'DefaultT[Optional[SSLOptions]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, connection_attempts: 'DefaultT[int]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, retry_delay: 'DefaultT[float]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, socket_timeout: 'DefaultT[Optional[float]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, stack_timeout: 'DefaultT[Optional[float]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, locale: 'DefaultT[str]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, blocked_connection_timeout: 'DefaultT[Optional[float]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, client_properties: 'DefaultT[Optional[Dict[str, Any]]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, tcp_options: 'DefaultT[Optional[Dict[str, Any]]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, **kwargs: 'Any') -> 'None' | Create a new ConnectionParameters instance. See `Parameters` for | default values. | | :param str host: Hostname or IP Address to connect to | :param int port: TCP port to connect to | :param str virtual_host: RabbitMQ virtual host to use | :param pika.credentials.PlainCredentials credentials: auth credentials | :param int channel_max: Maximum number of channels to allow | :param int frame_max: The maximum byte size for an AMQP frame | :param int|None|callable heartbeat: Controls AMQP heartbeat timeout negotiation | during connection tuning. An integer value always overrides the value | proposed by broker. Use 0 to deactivate heartbeats and None to always | accept the broker's proposal. If a callable is given, it will be called | with the connection instance and the heartbeat timeout proposed by broker | as its arguments. The callback should return a non-negative integer that | will be used to override the broker's proposal. | :param `pika.SSLOptions`|None ssl_options: None for plaintext or | `pika.SSLOptions` instance for SSL/TLS. Defaults to None. | :param int connection_attempts: Maximum number of retry attempts | :param int|float retry_delay: Time to wait in seconds, before the next | :param int|float socket_timeout: Positive socket connect timeout in | seconds. | :param int|float stack_timeout: Positive full protocol stack | (TCP/[SSL]/AMQP) bring-up timeout in seconds. It's recommended to | set this value higher than `socket_timeout`. | :param str locale: Set the locale value | :param int|float|None blocked_connection_timeout: If not None, | the value is a non-negative timeout, in seconds, for the | connection to remain blocked (triggered by Connection.Blocked from | broker); if the timeout expires before connection becomes unblocked, | the connection will be torn down, triggering the adapter-specific | mechanism for informing client app about the closed connection: | passing `ConnectionBlockedTimeout` exception to on_close_callback | in asynchronous adapters or raising it in `BlockingConnection`. | :param client_properties: None or dict of client properties used to | override the fields in the default client properties reported to | RabbitMQ via `Connection.StartOk` method. | :param tcp_options: None or a dict of TCP options to set for socket | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | DefaultT = typing.Union[~T, typing.Type[pika.connection.ConnectionPara... | | T = ~T | | ---------------------------------------------------------------------- | Methods inherited from Parameters: | | __eq__(self, other) -> 'bool' | Return self==value. | | __ne__(self, other) -> 'bool' | Return self!=value. | | __repr__(self) -> 'str' | Represent the info about the instance. | | :rtype: str | | ---------------------------------------------------------------------- | Data descriptors inherited from Parameters: | | blocked_connection_timeout | :returns: blocked connection timeout. Defaults to | `DEFAULT_BLOCKED_CONNECTION_TIMEOUT`. | :rtype: float|None | | channel_max | :returns: max preferred number of channels. Defaults to | `DEFAULT_CHANNEL_MAX`. | :rtype: int | | client_properties | :returns: client properties used to override the fields in the default | client properties reported to RabbitMQ via `Connection.StartOk` | method. Defaults to `DEFAULT_CLIENT_PROPERTIES`. | :rtype: dict|None | | connection_attempts | :returns: number of socket connection attempts. Defaults to | `DEFAULT_CONNECTION_ATTEMPTS`. See also `retry_delay`. | :rtype: int | | credentials | :rtype: one of the classes from `pika.credentials.VALID_TYPES`. Defaults | to `DEFAULT_CREDENTIALS`. | | frame_max | :returns: desired maximum AMQP frame size to use. Defaults to | `DEFAULT_FRAME_MAX`. | :rtype: int | | heartbeat | :returns: AMQP connection heartbeat timeout value for negotiation during | connection tuning or callable which is invoked during connection tuning. | None to accept broker's value. 0 turns heartbeat off. Defaults to | `DEFAULT_HEARTBEAT_TIMEOUT`. | :rtype: int|callable|None | | host | :returns: hostname or ip address of broker. Defaults to `DEFAULT_HOST`. | :rtype: str | | locale | :returns: locale value to pass to broker; e.g., 'en_US'. Defaults to | `DEFAULT_LOCALE`. | :rtype: str | | port | :returns: port number of broker's listening socket. Defaults to | `DEFAULT_PORT`. | :rtype: int | | retry_delay | :returns: interval between socket connection attempts; see also | `connection_attempts`. Defaults to `DEFAULT_RETRY_DELAY`. | :rtype: float | | socket_timeout | :returns: socket connect timeout in seconds. Defaults to | `DEFAULT_SOCKET_TIMEOUT`. The value None disables this timeout. | :rtype: float|None | | ssl_options | :returns: None for plaintext or `pika.SSLOptions` instance for SSL/TLS. | :rtype: `pika.SSLOptions`|None | | stack_timeout | :returns: full protocol stack TCP/[SSL]/AMQP bring-up timeout in | seconds. Defaults to `DEFAULT_STACK_TIMEOUT`. The value None | disables this timeout. | :rtype: float | | tcp_options | :returns: None or a dict of options to pass to the underlying socket | :rtype: dict|None | | virtual_host | :returns: rabbitmq virtual host name. Defaults to | `DEFAULT_VIRTUAL_HOST`. | :rtype: str | | ---------------------------------------------------------------------- | Data and other attributes inherited from Parameters: | | DEFAULT_BLOCKED_CONNECTION_TIMEOUT = None | | DEFAULT_CHANNEL_MAX = 65535 | | DEFAULT_CLIENT_PROPERTIES = None | | DEFAULT_CONNECTION_ATTEMPTS = 1 | | DEFAULT_CREDENTIALS = <pika.credentials.PlainCredentials object> | | DEFAULT_FRAME_MAX = 131072 | | DEFAULT_HEARTBEAT_TIMEOUT = None | | DEFAULT_HOST = 'localhost' | | DEFAULT_LOCALE = 'en_US' | | DEFAULT_PASSWORD = 'guest' | | DEFAULT_PORT = 5672 | | DEFAULT_RETRY_DELAY = 2.0 | | DEFAULT_SOCKET_TIMEOUT = 10.0 | | DEFAULT_SSL = False | | DEFAULT_SSL_OPTIONS = None | | DEFAULT_SSL_PORT = 5671 | | DEFAULT_STACK_TIMEOUT = 15.0 | | DEFAULT_TCP_OPTIONS = None | | DEFAULT_USERNAME = 'guest' | | DEFAULT_VIRTUAL_HOST = '/' | | __hash__ = None
pika.DeliveryMode
Python Library Documentation: class DeliveryMode in module pika.delivery_mode class DeliveryMode(enum.Enum) | DeliveryMode(*values) | | Method resolution order: | DeliveryMode | enum.Enum | builtins.object | | Data and other attributes defined here: | | Persistent = <DeliveryMode.Persistent: 2> | | Transient = <DeliveryMode.Transient: 1> | | ---------------------------------------------------------------------- | Data descriptors inherited from enum.Enum: | | name | The name of the Enum member. | | value | The value of the Enum member. | | ---------------------------------------------------------------------- | Static methods inherited from enum.EnumType: | | __contains__(value) | Return True if `value` is in `cls`. | | `value` is in `cls` if: | 1) `value` is a member of `cls`, or | 2) `value` is the value of one of the `cls`'s members. | | __getitem__(name) | Return the member matching `name`. | | __iter__() | Return members in definition order. | | __len__() | Return the number of members (no aliases) | | ---------------------------------------------------------------------- | Readonly properties inherited from enum.EnumType: | | __members__ | Returns a mapping of member name->value. | | This mapping lists all enum members, including aliases. Note that this | is a read-only view of the internal mapping.
pika.PlainCredentials
Python Library Documentation: class PlainCredentials in module pika.credentials class PlainCredentials(builtins.object) | PlainCredentials(username: 'str', password: 'str', erase_on_connect: 'bool' = False) | | A credentials object for the default authentication methodology with | RabbitMQ. | | If you do not pass in credentials to the ConnectionParameters object, it | will create credentials for 'guest' with the password of 'guest'. | | If you pass True to erase_on_connect the credentials will not be stored | in memory after the Connection attempt has been made. | | :param str username: The username to authenticate with | :param str password: The password to authenticate with | :param bool erase_on_connect: erase credentials on connect. | | Methods defined here: | | __eq__(self, other) -> 'bool' | Return self==value. | | __init__(self, username: 'str', password: 'str', erase_on_connect: 'bool' = False) | Create a new instance of PlainCredentials | | :param str username: The username to authenticate with | :param str password: The password to authenticate with | :param bool erase_on_connect: erase credentials on connect. | | __ne__(self, other) -> 'bool' | Return self!=value. | | erase_credentials(self) -> 'None' | Called by Connection when it no longer needs the credentials | | response_for(self, start: 'Connection.Start') -> 'Tuple[Optional[str], Optional[bytes]]' | Validate that this type of authentication is supported | | :param spec.Connection.Start start: Connection.Start method | :rtype: tuple(str|None, bytes|None) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | TYPE = 'PLAIN' | | __hash__ = None
pika.SSLOptions
Python Library Documentation: class SSLOptions in module pika.connection class SSLOptions(builtins.object) | SSLOptions(context: 'ssl.SSLContext', server_hostname: 'Optional[str]' = None) -> 'None' | | Class used to provide parameters for optional fine grained control of SSL | socket wrapping. | | Methods defined here: | | __init__(self, context: 'ssl.SSLContext', server_hostname: 'Optional[str]' = None) -> 'None' | :param ssl.SSLContext context: SSLContext instance | :param str|None server_hostname: SSLContext.wrap_socket, used to enable | SNI | | ---------------------------------------------------------------------- | Data descriptors defined here: | | context | | server_hostname
pika.SelectConnection
Python Library Documentation: class SelectConnection in module pika.adapters.select_connection class SelectConnection(pika.adapters.base_connection.BaseConnection) | SelectConnection(parameters: 'Optional[connection.Parameters]' = None, on_open_callback: 'Optional[Callable[[connection.Connection], None]]' = None, on_open_error_callback: 'Optional[Callable[[connection.Connection, BaseException], None]]' = None, on_close_callback: 'Optional[Callable[[connection.Connection, BaseException], None]]' = None, custom_ioloop: 'Optional[Union[nbio_interface.AbstractIOServices, IOLoop]]' = None, internal_connection_workflow: 'bool' = True) -> 'None' | | An asynchronous connection adapter that attempts to use the fastest | event loop adapter for the given platform. | | Method resolution order: | SelectConnection | pika.adapters.base_connection.BaseConnection | pika.connection.Connection | abc.AbstractBase | builtins.object | | Methods defined here: | | __init__(self, parameters: 'Optional[connection.Parameters]' = None, on_open_callback: 'Optional[Callable[[connection.Connection], None]]' = None, on_open_error_callback: 'Optional[Callable[[connection.Connection, BaseException], None]]' = None, on_close_callback: 'Optional[Callable[[connection.Connection, BaseException], None]]' = None, custom_ioloop: 'Optional[Union[nbio_interface.AbstractIOServices, IOLoop]]' = None, internal_connection_workflow: 'bool' = True) -> 'None' | Create a new instance of the Connection object. | | :param pika.connection.Parameters parameters: Connection parameters | :param callable on_open_callback: Method to call on connection open | :param None | method on_open_error_callback: Called if the connection | can't be established or connection establishment is interrupted by | `Connection.close()`: on_open_error_callback(Connection, exception). | :param None | method on_close_callback: Called when a previously fully | open connection is closed: | `on_close_callback(Connection, exception)`, where `exception` is | either an instance of `exceptions.ConnectionClosed` if closed by | user or broker or exception of another type that describes the cause | of connection failure. | :param None | IOLoop | nbio_interface.AbstractIOServices custom_ioloop: | Provide a custom I/O Loop object. | :param bool internal_connection_workflow: True for autonomous connection | establishment which is default; False for externally-managed | connection workflow via the `create_connection()` factory. | :raises: RuntimeError | | ---------------------------------------------------------------------- | Class methods defined here: | | create_connection(connection_configs: 'Sequence[connection.Parameters]', on_done: 'Callable[[Union[connection.Connection, connection_workflow.AMQPConnectorException]], None]', custom_ioloop: 'Optional[Any]' = None, workflow: 'Optional[connection_workflow.AbstractAMQPConnectionWorkflow]' = None) -> 'connection_workflow.AbstractAMQPConnectionWorkflow' | Implement | :py:classmethod::`pika.adapters.BaseConnection.create_connection()`. | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | __abstractmethods__ = frozenset() | | ---------------------------------------------------------------------- | Methods inherited from pika.adapters.base_connection.BaseConnection: | | __repr__(self) -> 'str' | Return repr(self). | | ---------------------------------------------------------------------- | Readonly properties inherited from pika.adapters.base_connection.BaseConnection: | | ioloop | :returns: the native I/O loop instance underlying async services selected | by user or the default selected by the specialized connection | adapter (e.g., Twisted reactor, `asyncio.SelectorEventLoop`, | `select_connection.IOLoop`, etc.) | :rtype: object | | ---------------------------------------------------------------------- | Methods inherited from pika.connection.Connection: | | add_on_close_callback(self, callback: 'Callable[[Connection, Exception], Any]') -> 'None' | Add a callback notification when the connection has closed. The | callback will be passed the connection and an exception instance. The | exception will either be an instance of `exceptions.ConnectionClosed` if | a fully-open connection was closed by user or broker or exception of | another type that describes the cause of connection closure/failure. | | :param callable callback: Callback to call on close, having the signature: | callback(pika.connection.Connection, exception) | | add_on_connection_blocked_callback(self, callback: 'Callable[[Connection, frame.Method[spec.Connection.Blocked]], Any]') -> 'None' | RabbitMQ AMQP extension - Add a callback to be notified when the | connection gets blocked (`Connection.Blocked` received from RabbitMQ) | due to the broker running low on resources (memory or disk). In this | state RabbitMQ suspends processing incoming data until the connection | is unblocked, so it's a good idea for publishers receiving this | notification to suspend publishing until the connection becomes | unblocked. | | See also `Connection.add_on_connection_unblocked_callback()` | | See also `ConnectionParameters.blocked_connection_timeout`. | | :param callable callback: Callback to call on `Connection.Blocked`, | having the signature `callback(connection, pika.frame.Method)`, | where the method frame's `method` member is of type | `pika.spec.Connection.Blocked` | | add_on_connection_unblocked_callback(self, callback: 'Callable[[Connection, frame.Method[spec.Connection.Unblocked]], Any]') -> 'None' | RabbitMQ AMQP extension - Add a callback to be notified when the | connection gets unblocked (`Connection.Unblocked` frame is received from | RabbitMQ) letting publishers know it's ok to start publishing again. | | :param callable callback: Callback to call on | `Connection.Unblocked`, having the signature | `callback(connection, pika.frame.Method)`, where the method frame's | `method` member is of type `pika.spec.Connection.Unblocked` | | add_on_open_callback(self, callback: 'Callable[[Connection], Any]') -> 'None' | Add a callback notification when the connection has opened. The | callback will be passed the connection instance as its only arg. | | :param callable callback: Callback to call when open | | add_on_open_error_callback(self, callback: 'Callable[[Connection, Optional[BaseException]], Any]', remove_default: 'bool' = True) -> 'None' | Add a callback notification when the connection can not be opened. | | The callback method should accept the connection instance that could not | connect, and either a string or an exception as its second arg. | | :param callable callback: Callback to call when can't connect, having | the signature _(Connection, Exception) | :param bool remove_default: Remove default exception raising callback | | channel(self, channel_number: 'Optional[int]' = None, on_open_callback: 'Optional[Callable[[Channel], Any]]' = None) -> 'Channel' | Create a new channel with the next available channel number or pass | in a channel number to use. Must be non-zero if you would like to | specify but it is recommended that you let Pika manage the channel | numbers. | | :param int channel_number: The channel number to use, defaults to the | next available. | :param callable on_open_callback: The callback when the channel is | opened. The callback will be invoked with the `Channel` instance | as its only argument. | :rtype: pika.channel.Channel | | close(self, reply_code: 'int' = 200, reply_text: 'str' = 'Normal shutdown') -> 'None' | Disconnect from RabbitMQ. If there are any open channels, it will | attempt to close them prior to fully disconnecting. Channels which | have active consumers will attempt to send a Basic.Cancel to RabbitMQ | to cleanly stop the delivery of messages prior to closing the channel. | | :param int reply_code: The code number for the close | :param str reply_text: The text reason for the close | | :raises pika.exceptions.ConnectionWrongStateError: if connection is | closed or closing. | | update_secret(self, new_secret: 'str', reason: 'str', callback: 'Optional[Callable[[frame.Method[spec.Connection.UpdateSecretOk]], Any]]' = None) -> 'None' | RabbitMQ AMQP extension - This method updates the secret used to authenticate this connection. | It is used when secrets have an expiration date and need to be renewed, like OAuth 2 tokens. | Pass a callback to be notified of the response from the server. | | :param string new_secret: The new secret | :param string reason: The reason for the secret update | :param callable callback: Callback to call on | `Connection.UpdateSecretOk`, having the signature | `callback(pika.frame.Method)`, where the method frame's | `method` member is of type `pika.spec.Connection.UpdateSecretOk` | | :raises pika.exceptions.ConnectionWrongStateError: if connection is | not open. | | ---------------------------------------------------------------------- | Readonly properties inherited from pika.connection.Connection: | | basic_nack | Specifies if the server supports basic.nack on the active connection. | | :rtype: bool | | consumer_cancel_notify | Specifies if the server supports consumer cancel notification on the | active connection. | | :rtype: bool | | exchange_exchange_bindings | Specifies if the active connection supports exchange to exchange | bindings. | | :rtype: bool | | is_closed | Returns a boolean reporting the current connection state. | | is_closing | Returns True if connection is in the process of closing due to | client-initiated `close` request, but closing is not yet complete. | | is_open | Returns a boolean reporting the current connection state. | | publisher_confirms | Specifies if the active connection can use publisher confirmations. | | :rtype: bool | | ---------------------------------------------------------------------- | Data and other attributes inherited from pika.connection.Connection: | | CONNECTION_CLOSED = 0 | | CONNECTION_CLOSING = 6 | | CONNECTION_INIT = 1 | | CONNECTION_OPEN = 5 | | CONNECTION_PROTOCOL = 2 | | CONNECTION_START = 3 | | CONNECTION_TUNE = 4 | | ON_CONNECTION_CLOSED = '_on_connection_closed' | | ON_CONNECTION_ERROR = '_on_connection_error' | | ON_CONNECTION_OPEN_OK = '_on_connection_open_ok' | | ---------------------------------------------------------------------- | Data descriptors inherited from abc.AbstractBase: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
pika.URLParameters
Python Library Documentation: class URLParameters in module pika.connection class URLParameters(Parameters) | URLParameters(url: 'str') -> 'None' | | Connect to RabbitMQ via an AMQP URL in the format:: | | amqp://username:password@host:port/<virtual_host>[?query-string] | | Ensure that the virtual host is URI encoded when specified. For example if | you are using the default "/" virtual host, the value should be `%2f`. | | See `Parameters` for default values. | | Valid query string values are: | | - channel_max: | Override the default maximum channel count value | - client_properties: | dict of client properties used to override the fields in the default | client properties reported to RabbitMQ via `Connection.StartOk` | method | - connection_attempts: | Specify how many times pika should try and reconnect before it gives up | - frame_max: | Override the default maximum frame size for communication | - heartbeat: | Desired connection heartbeat timeout for negotiation. If not present | the broker's value is accepted. 0 turns heartbeat off. | - locale: | Override the default `en_US` locale value | - ssl_options: | None for plaintext; for SSL: dict of public ssl context-related | arguments that may be passed to :meth:`ssl.SSLSocket` as kwargs, | except `sock`, `server_side`,`do_handshake_on_connect`, `family`, | `type`, `proto`, `fileno`. | - retry_delay: | The number of seconds to sleep before attempting to connect on | connection failure. | - socket_timeout: | Socket connect timeout value in seconds (float or int) | - stack_timeout: | Positive full protocol stack (TCP/[SSL]/AMQP) bring-up timeout in | seconds. It's recommended to set this value higher than | `socket_timeout`. | - blocked_connection_timeout: | Set the timeout, in seconds, that the connection may remain blocked | (triggered by Connection.Blocked from broker); if the timeout | expires before connection becomes unblocked, the connection will be | torn down, triggering the connection's on_close_callback | - tcp_options: | Set the tcp options for the underlying socket. | | :param str url: The AMQP URL to connect to | | Method resolution order: | URLParameters | Parameters | builtins.object | | Methods defined here: | | __init__(self, url: 'str') -> 'None' | Create a new URLParameters instance. | | :param str url: The URL value | | ---------------------------------------------------------------------- | Methods inherited from Parameters: | | __eq__(self, other) -> 'bool' | Return self==value. | | __ne__(self, other) -> 'bool' | Return self!=value. | | __repr__(self) -> 'str' | Represent the info about the instance. | | :rtype: str | | ---------------------------------------------------------------------- | Data descriptors inherited from Parameters: | | blocked_connection_timeout | :returns: blocked connection timeout. Defaults to | `DEFAULT_BLOCKED_CONNECTION_TIMEOUT`. | :rtype: float|None | | channel_max | :returns: max preferred number of channels. Defaults to | `DEFAULT_CHANNEL_MAX`. | :rtype: int | | client_properties | :returns: client properties used to override the fields in the default | client properties reported to RabbitMQ via `Connection.StartOk` | method. Defaults to `DEFAULT_CLIENT_PROPERTIES`. | :rtype: dict|None | | connection_attempts | :returns: number of socket connection attempts. Defaults to | `DEFAULT_CONNECTION_ATTEMPTS`. See also `retry_delay`. | :rtype: int | | credentials | :rtype: one of the classes from `pika.credentials.VALID_TYPES`. Defaults | to `DEFAULT_CREDENTIALS`. | | frame_max | :returns: desired maximum AMQP frame size to use. Defaults to | `DEFAULT_FRAME_MAX`. | :rtype: int | | heartbeat | :returns: AMQP connection heartbeat timeout value for negotiation during | connection tuning or callable which is invoked during connection tuning. | None to accept broker's value. 0 turns heartbeat off. Defaults to | `DEFAULT_HEARTBEAT_TIMEOUT`. | :rtype: int|callable|None | | host | :returns: hostname or ip address of broker. Defaults to `DEFAULT_HOST`. | :rtype: str | | locale | :returns: locale value to pass to broker; e.g., 'en_US'. Defaults to | `DEFAULT_LOCALE`. | :rtype: str | | port | :returns: port number of broker's listening socket. Defaults to | `DEFAULT_PORT`. | :rtype: int | | retry_delay | :returns: interval between socket connection attempts; see also | `connection_attempts`. Defaults to `DEFAULT_RETRY_DELAY`. | :rtype: float | | socket_timeout | :returns: socket connect timeout in seconds. Defaults to | `DEFAULT_SOCKET_TIMEOUT`. The value None disables this timeout. | :rtype: float|None | | ssl_options | :returns: None for plaintext or `pika.SSLOptions` instance for SSL/TLS. | :rtype: `pika.SSLOptions`|None | | stack_timeout | :returns: full protocol stack TCP/[SSL]/AMQP bring-up timeout in | seconds. Defaults to `DEFAULT_STACK_TIMEOUT`. The value None | disables this timeout. | :rtype: float | | tcp_options | :returns: None or a dict of options to pass to the underlying socket | :rtype: dict|None | | virtual_host | :returns: rabbitmq virtual host name. Defaults to | `DEFAULT_VIRTUAL_HOST`. | :rtype: str | | ---------------------------------------------------------------------- | Data and other attributes inherited from Parameters: | | DEFAULT_BLOCKED_CONNECTION_TIMEOUT = None | | DEFAULT_CHANNEL_MAX = 65535 | | DEFAULT_CLIENT_PROPERTIES = None | | DEFAULT_CONNECTION_ATTEMPTS = 1 | | DEFAULT_CREDENTIALS = <pika.credentials.PlainCredentials object> | | DEFAULT_FRAME_MAX = 131072 | | DEFAULT_HEARTBEAT_TIMEOUT = None | | DEFAULT_HOST = 'localhost' | | DEFAULT_LOCALE = 'en_US' | | DEFAULT_PASSWORD = 'guest' | | DEFAULT_PORT = 5672 | | DEFAULT_RETRY_DELAY = 2.0 | | DEFAULT_SOCKET_TIMEOUT = 10.0 | | DEFAULT_SSL = False | | DEFAULT_SSL_OPTIONS = None | | DEFAULT_SSL_PORT = 5671 | | DEFAULT_STACK_TIMEOUT = 15.0 | | DEFAULT_TCP_OPTIONS = None | | DEFAULT_USERNAME = 'guest' | | DEFAULT_VIRTUAL_HOST = '/' | | __hash__ = None
pika.adapters
Python Library Documentation: package pika.adapters in pika
NAME
pika.adapters
DESCRIPTION
Connection Adapters
===================
Pika provides multiple adapters to connect to RabbitMQ:
- adapters.asyncio_connection.AsyncioConnection: Native Python3 AsyncIO use
- adapters.blocking_connection.BlockingConnection: Enables blocking,
synchronous operation on top of library for simple uses.
- adapters.gevent_connection.GeventConnection: Connection adapter for use with
Gevent.
- adapters.select_connection.SelectConnection: A native event based connection
adapter that implements select, kqueue, poll and epoll.
- adapters.tornado_connection.TornadoConnection: Connection adapter for use
with the Tornado web framework.
- adapters.twisted_connection.TwistedProtocolConnection: Connection adapter for
use with the Twisted framework
PACKAGE CONTENTS
asyncio_connection
base_connection
blocking_connection
gevent_connection
select_connection
tornado_connection
twisted_connection
utils (package)
CLASSES
builtins.object
pika.adapters.blocking_connection.BlockingConnection
pika.adapters.utils.selector_ioloop_adapter.AbstractSelectorIOLoop(builtins.object)
pika.adapters.select_connection.IOLoop
pika.connection.Connection(abc.AbstractBase)
pika.adapters.base_connection.BaseConnection
pika.adapters.asyncio_connection.AsyncioConnection
pika.adapters.select_connection.SelectConnection
class AsyncioConnection(pika.adapters.base_connection.BaseConnection)
| AsyncioConnection(parameters: 'Optional[connection.Parameters]' = None, on_open_callback: 'Optional[Callable[[connection.Connection], None]]' = None, on_open_error_callback: 'Optional[Callable[[connection.Connection, BaseException], None]]' = None, on_close_callback: 'Optional[Callable[[connection.Connection, BaseException], None]]' = None, custom_ioloop: 'Optional[Union[asyncio.AbstractEventLoop, nbio_interface.AbstractIOServices]]' = None, internal_connection_workflow: 'bool' = True) -> 'None'
|
| The AsyncioConnection runs on the Asyncio EventLoop.
|
| Method resolution order:
| AsyncioConnection
| pika.adapters.base_connection.BaseConnection
| pika.connection.Connection
| abc.AbstractBase
| builtins.object
|
| Methods defined here:
|
| __init__(self, parameters: 'Optional[connection.Parameters]' = None, on_open_callback: 'Optional[Callable[[connection.Connection], None]]' = None, on_open_error_callback: 'Optional[Callable[[connection.Connection, BaseException], None]]' = None, on_close_callback: 'Optional[Callable[[connection.Connection, BaseException], None]]' = None, custom_ioloop: 'Optional[Union[asyncio.AbstractEventLoop, nbio_interface.AbstractIOServices]]' = None, internal_connection_workflow: 'bool' = True) -> 'None'
| Create a new instance of the AsyncioConnection class, connecting
| to RabbitMQ automatically
|
| :param pika.connection.Parameters parameters: Connection parameters
| :param callable on_open_callback: The method to call when the connection
| is open
| :param None | method on_open_error_callback: Called if the connection
| can't be established or connection establishment is interrupted by
| `Connection.close()`: on_open_error_callback(Connection, exception).
| :param None | method on_close_callback: Called when a previously fully
| open connection is closed:
| `on_close_callback(Connection, exception)`, where `exception` is
| either an instance of `exceptions.ConnectionClosed` if closed by
| user or broker or exception of another type that describes the cause
| of connection failure.
| :param None | asyncio.AbstractEventLoop |
| nbio_interface.AbstractIOServices custom_ioloop:
| Defaults to the running event loop, or a new event loop when
| none is running.
| :param bool internal_connection_workflow: True for autonomous connection
| establishment which is default; False for externally-managed
| connection workflow via the `create_connection()` factory.
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| create_connection(connection_configs: 'Sequence[connection.Parameters]', on_done: 'Callable[[Union[connection.Connection, connection_workflow.AMQPConnectorException]], None]', custom_ioloop: 'Optional[asyncio.AbstractEventLoop]' = None, workflow: 'Optional[connection_workflow.AbstractAMQPConnectionWorkflow]' = None) -> 'connection_workflow.AbstractAMQPConnectionWorkflow'
| Implement
| :py:classmethod::`pika.adapters.BaseConnection.create_connection()`.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __abstractmethods__ = frozenset()
|
| ----------------------------------------------------------------------
| Methods inherited from pika.adapters.base_connection.BaseConnection:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Readonly properties inherited from pika.adapters.base_connection.BaseConnection:
|
| ioloop
| :returns: the native I/O loop instance underlying async services selected
| by user or the default selected by the specialized connection
| adapter (e.g., Twisted reactor, `asyncio.SelectorEventLoop`,
| `select_connection.IOLoop`, etc.)
| :rtype: object
|
| ----------------------------------------------------------------------
| Methods inherited from pika.connection.Connection:
|
| add_on_close_callback(self, callback: 'Callable[[Connection, Exception], Any]') -> 'None'
| Add a callback notification when the connection has closed. The
| callback will be passed the connection and an exception instance. The
| exception will either be an instance of `exceptions.ConnectionClosed` if
| a fully-open connection was closed by user or broker or exception of
| another type that describes the cause of connection closure/failure.
|
| :param callable callback: Callback to call on close, having the signature:
| callback(pika.connection.Connection, exception)
|
| add_on_connection_blocked_callback(self, callback: 'Callable[[Connection, frame.Method[spec.Connection.Blocked]], Any]') -> 'None'
| RabbitMQ AMQP extension - Add a callback to be notified when the
| connection gets blocked (`Connection.Blocked` received from RabbitMQ)
| due to the broker running low on resources (memory or disk). In this
| state RabbitMQ suspends processing incoming data until the connection
| is unblocked, so it's a good idea for publishers receiving this
| notification to suspend publishing until the connection becomes
| unblocked.
|
| See also `Connection.add_on_connection_unblocked_callback()`
|
| See also `ConnectionParameters.blocked_connection_timeout`.
|
| :param callable callback: Callback to call on `Connection.Blocked`,
| having the signature `callback(connection, pika.frame.Method)`,
| where the method frame's `method` member is of type
| `pika.spec.Connection.Blocked`
|
| add_on_connection_unblocked_callback(self, callback: 'Callable[[Connection, frame.Method[spec.Connection.Unblocked]], Any]') -> 'None'
| RabbitMQ AMQP extension - Add a callback to be notified when the
| connection gets unblocked (`Connection.Unblocked` frame is received from
| RabbitMQ) letting publishers know it's ok to start publishing again.
|
| :param callable callback: Callback to call on
| `Connection.Unblocked`, having the signature
| `callback(connection, pika.frame.Method)`, where the method frame's
| `method` member is of type `pika.spec.Connection.Unblocked`
|
| add_on_open_callback(self, callback: 'Callable[[Connection], Any]') -> 'None'
| Add a callback notification when the connection has opened. The
| callback will be passed the connection instance as its only arg.
|
| :param callable callback: Callback to call when open
|
| add_on_open_error_callback(self, callback: 'Callable[[Connection, Optional[BaseException]], Any]', remove_default: 'bool' = True) -> 'None'
| Add a callback notification when the connection can not be opened.
|
| The callback method should accept the connection instance that could not
| connect, and either a string or an exception as its second arg.
|
| :param callable callback: Callback to call when can't connect, having
| the signature _(Connection, Exception)
| :param bool remove_default: Remove default exception raising callback
|
| channel(self, channel_number: 'Optional[int]' = None, on_open_callback: 'Optional[Callable[[Channel], Any]]' = None) -> 'Channel'
| Create a new channel with the next available channel number or pass
| in a channel number to use. Must be non-zero if you would like to
| specify but it is recommended that you let Pika manage the channel
| numbers.
|
| :param int channel_number: The channel number to use, defaults to the
| next available.
| :param callable on_open_callback: The callback when the channel is
| opened. The callback will be invoked with the `Channel` instance
| as its only argument.
| :rtype: pika.channel.Channel
|
| close(self, reply_code: 'int' = 200, reply_text: 'str' = 'Normal shutdown') -> 'None'
| Disconnect from RabbitMQ. If there are any open channels, it will
| attempt to close them prior to fully disconnecting. Channels which
| have active consumers will attempt to send a Basic.Cancel to RabbitMQ
| to cleanly stop the delivery of messages prior to closing the channel.
|
| :param int reply_code: The code number for the close
| :param str reply_text: The text reason for the close
|
| :raises pika.exceptions.ConnectionWrongStateError: if connection is
| closed or closing.
|
| update_secret(self, new_secret: 'str', reason: 'str', callback: 'Optional[Callable[[frame.Method[spec.Connection.UpdateSecretOk]], Any]]' = None) -> 'None'
| RabbitMQ AMQP extension - This method updates the secret used to authenticate this connection.
| It is used when secrets have an expiration date and need to be renewed, like OAuth 2 tokens.
| Pass a callback to be notified of the response from the server.
|
| :param string new_secret: The new secret
| :param string reason: The reason for the secret update
| :param callable callback: Callback to call on
| `Connection.UpdateSecretOk`, having the signature
| `callback(pika.frame.Method)`, where the method frame's
| `method` member is of type `pika.spec.Connection.UpdateSecretOk`
|
| :raises pika.exceptions.ConnectionWrongStateError: if connection is
| not open.
|
| ----------------------------------------------------------------------
| Readonly properties inherited from pika.connection.Connection:
|
| basic_nack
| Specifies if the server supports basic.nack on the active connection.
|
| :rtype: bool
|
| consumer_cancel_notify
| Specifies if the server supports consumer cancel notification on the
| active connection.
|
| :rtype: bool
|
| exchange_exchange_bindings
| Specifies if the active connection supports exchange to exchange
| bindings.
|
| :rtype: bool
|
| is_closed
| Returns a boolean reporting the current connection state.
|
| is_closing
| Returns True if connection is in the process of closing due to
| client-initiated `close` request, but closing is not yet complete.
|
| is_open
| Returns a boolean reporting the current connection state.
|
| publisher_confirms
| Specifies if the active connection can use publisher confirmations.
|
| :rtype: bool
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from pika.connection.Connection:
|
| CONNECTION_CLOSED = 0
|
| CONNECTION_CLOSING = 6
|
| CONNECTION_INIT = 1
|
| CONNECTION_OPEN = 5
|
| CONNECTION_PROTOCOL = 2
|
| CONNECTION_START = 3
|
| CONNECTION_TUNE = 4
|
| ON_CONNECTION_CLOSED = '_on_connection_closed'
|
| ON_CONNECTION_ERROR = '_on_connection_error'
|
| ON_CONNECTION_OPEN_OK = '_on_connection_open_ok'
|
| ----------------------------------------------------------------------
| Data descriptors inherited from abc.AbstractBase:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class BaseConnection(pika.connection.Connection)
| BaseConnection(parameters: 'Optional[connection.Parameters]', on_open_callback: 'Optional[Callable[[connection.Connection], None]]', on_open_error_callback: 'Optional[Callable[[connection.Connection, BaseException], None]]', on_close_callback: 'Optional[Callable[[connection.Connection, BaseException], None]]', nbio: 'nbio_interface.AbstractIOServices', internal_connection_workflow: 'bool' = True) -> 'None'
|
| BaseConnection class that should be extended by connection adapters.
|
| This class abstracts I/O loop and transport services from pika core.
|
| Method resolution order:
| BaseConnection
| pika.connection.Connection
| abc.AbstractBase
| builtins.object
|
| Methods defined here:
|
| __init__(self, parameters: 'Optional[connection.Parameters]', on_open_callback: 'Optional[Callable[[connection.Connection], None]]', on_open_error_callback: 'Optional[Callable[[connection.Connection, BaseException], None]]', on_close_callback: 'Optional[Callable[[connection.Connection, BaseException], None]]', nbio: 'nbio_interface.AbstractIOServices', internal_connection_workflow: 'bool' = True) -> 'None'
| Create a new instance of the Connection object.
|
| :param None|pika.connection.Parameters parameters: Connection parameters
| :param None|method on_open_callback: Method to call on connection open
| :param None | method on_open_error_callback: Called if the connection
| can't be established or connection establishment is interrupted by
| `Connection.close()`: on_open_error_callback(Connection, exception).
| :param None | method on_close_callback: Called when a previously fully
| open connection is closed:
| `on_close_callback(Connection, exception)`, where `exception` is
| either an instance of `exceptions.ConnectionClosed` if closed by
| user or broker or exception of another type that describes the cause
| of connection failure.
| :param pika.adapters.utils.nbio_interface.AbstractIOServices nbio:
| asynchronous services
| :param bool internal_connection_workflow: True for autonomous connection
| establishment which is default; False for externally-managed
| connection workflow via the `create_connection()` factory.
| :raises: RuntimeError
| :raises: ValueError
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| create_connection(connection_configs: 'Sequence[connection.Parameters]', on_done: 'Callable[[Union[connection.Connection, connection_workflow.AMQPConnectorException]], None]', custom_ioloop: 'Optional[Any]' = None, workflow: 'Optional[connection_workflow.AbstractAMQPConnectionWorkflow]' = None) -> 'connection_workflow.AbstractAMQPConnectionWorkflow'
| Asynchronously create a connection to an AMQP broker using the given
| configurations. Will attempt to connect using each config in the given
| order, including all compatible resolved IP addresses of the hostname
| supplied in each config, until one is established or all attempts fail.
|
| See also `_start_connection_workflow()`.
|
| :param sequence connection_configs: A sequence of one or more
| `pika.connection.Parameters`-based objects.
| :param callable on_done: as defined in
| `connection_workflow.AbstractAMQPConnectionWorkflow.start()`.
| :param object | None custom_ioloop: Provide a custom I/O loop that is
| native to the specific adapter implementation; if None, the adapter
| will use a default loop instance, which is typically a singleton.
| :param connection_workflow.AbstractAMQPConnectionWorkflow | None workflow:
| Pass an instance of an implementation of the
| `connection_workflow.AbstractAMQPConnectionWorkflow` interface;
| defaults to a `connection_workflow.AMQPConnectionWorkflow` instance
| with default values for optional args.
| :returns: Connection workflow instance in use. The user should limit
| their interaction with this object only to it's `abort()` method.
| :rtype: connection_workflow.AbstractAMQPConnectionWorkflow
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| ioloop
| :returns: the native I/O loop instance underlying async services selected
| by user or the default selected by the specialized connection
| adapter (e.g., Twisted reactor, `asyncio.SelectorEventLoop`,
| `select_connection.IOLoop`, etc.)
| :rtype: object
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __abstractmethods__ = frozenset({'create_connection'})
|
| ----------------------------------------------------------------------
| Methods inherited from pika.connection.Connection:
|
| add_on_close_callback(self, callback: 'Callable[[Connection, Exception], Any]') -> 'None'
| Add a callback notification when the connection has closed. The
| callback will be passed the connection and an exception instance. The
| exception will either be an instance of `exceptions.ConnectionClosed` if
| a fully-open connection was closed by user or broker or exception of
| another type that describes the cause of connection closure/failure.
|
| :param callable callback: Callback to call on close, having the signature:
| callback(pika.connection.Connection, exception)
|
| add_on_connection_blocked_callback(self, callback: 'Callable[[Connection, frame.Method[spec.Connection.Blocked]], Any]') -> 'None'
| RabbitMQ AMQP extension - Add a callback to be notified when the
| connection gets blocked (`Connection.Blocked` received from RabbitMQ)
| due to the broker running low on resources (memory or disk). In this
| state RabbitMQ suspends processing incoming data until the connection
| is unblocked, so it's a good idea for publishers receiving this
| notification to suspend publishing until the connection becomes
| unblocked.
|
| See also `Connection.add_on_connection_unblocked_callback()`
|
| See also `ConnectionParameters.blocked_connection_timeout`.
|
| :param callable callback: Callback to call on `Connection.Blocked`,
| having the signature `callback(connection, pika.frame.Method)`,
| where the method frame's `method` member is of type
| `pika.spec.Connection.Blocked`
|
| add_on_connection_unblocked_callback(self, callback: 'Callable[[Connection, frame.Method[spec.Connection.Unblocked]], Any]') -> 'None'
| RabbitMQ AMQP extension - Add a callback to be notified when the
| connection gets unblocked (`Connection.Unblocked` frame is received from
| RabbitMQ) letting publishers know it's ok to start publishing again.
|
| :param callable callback: Callback to call on
| `Connection.Unblocked`, having the signature
| `callback(connection, pika.frame.Method)`, where the method frame's
| `method` member is of type `pika.spec.Connection.Unblocked`
|
| add_on_open_callback(self, callback: 'Callable[[Connection], Any]') -> 'None'
| Add a callback notification when the connection has opened. The
| callback will be passed the connection instance as its only arg.
|
| :param callable callback: Callback to call when open
|
| add_on_open_error_callback(self, callback: 'Callable[[Connection, Optional[BaseException]], Any]', remove_default: 'bool' = True) -> 'None'
| Add a callback notification when the connection can not be opened.
|
| The callback method should accept the connection instance that could not
| connect, and either a string or an exception as its second arg.
|
| :param callable callback: Callback to call when can't connect, having
| the signature _(Connection, Exception)
| :param bool remove_default: Remove default exception raising callback
|
| channel(self, channel_number: 'Optional[int]' = None, on_open_callback: 'Optional[Callable[[Channel], Any]]' = None) -> 'Channel'
| Create a new channel with the next available channel number or pass
| in a channel number to use. Must be non-zero if you would like to
| specify but it is recommended that you let Pika manage the channel
| numbers.
|
| :param int channel_number: The channel number to use, defaults to the
| next available.
| :param callable on_open_callback: The callback when the channel is
| opened. The callback will be invoked with the `Channel` instance
| as its only argument.
| :rtype: pika.channel.Channel
|
| close(self, reply_code: 'int' = 200, reply_text: 'str' = 'Normal shutdown') -> 'None'
| Disconnect from RabbitMQ. If there are any open channels, it will
| attempt to close them prior to fully disconnecting. Channels which
| have active consumers will attempt to send a Basic.Cancel to RabbitMQ
| to cleanly stop the delivery of messages prior to closing the channel.
|
| :param int reply_code: The code number for the close
| :param str reply_text: The text reason for the close
|
| :raises pika.exceptions.ConnectionWrongStateError: if connection is
| closed or closing.
|
| update_secret(self, new_secret: 'str', reason: 'str', callback: 'Optional[Callable[[frame.Method[spec.Connection.UpdateSecretOk]], Any]]' = None) -> 'None'
| RabbitMQ AMQP extension - This method updates the secret used to authenticate this connection.
| It is used when secrets have an expiration date and need to be renewed, like OAuth 2 tokens.
| Pass a callback to be notified of the response from the server.
|
| :param string new_secret: The new secret
| :param string reason: The reason for the secret update
| :param callable callback: Callback to call on
| `Connection.UpdateSecretOk`, having the signature
| `callback(pika.frame.Method)`, where the method frame's
| `method` member is of type `pika.spec.Connection.UpdateSecretOk`
|
| :raises pika.exceptions.ConnectionWrongStateError: if connection is
| not open.
|
| ----------------------------------------------------------------------
| Readonly properties inherited from pika.connection.Connection:
|
| basic_nack
| Specifies if the server supports basic.nack on the active connection.
|
| :rtype: bool
|
| consumer_cancel_notify
| Specifies if the server supports consumer cancel notification on the
| active connection.
|
| :rtype: bool
|
| exchange_exchange_bindings
| Specifies if the active connection supports exchange to exchange
| bindings.
|
| :rtype: bool
|
| is_closed
| Returns a boolean reporting the current connection state.
|
| is_closing
| Returns True if connection is in the process of closing due to
| client-initiated `close` request, but closing is not yet complete.
|
| is_open
| Returns a boolean reporting the current connection state.
|
| publisher_confirms
| Specifies if the active connection can use publisher confirmations.
|
| :rtype: bool
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from pika.connection.Connection:
|
| CONNECTION_CLOSED = 0
|
| CONNECTION_CLOSING = 6
|
| CONNECTION_INIT = 1
|
| CONNECTION_OPEN = 5
|
| CONNECTION_PROTOCOL = 2
|
| CONNECTION_START = 3
|
| CONNECTION_TUNE = 4
|
| ON_CONNECTION_CLOSED = '_on_connection_closed'
|
| ON_CONNECTION_ERROR = '_on_connection_error'
|
| ON_CONNECTION_OPEN_OK = '_on_connection_open_ok'
|
| ----------------------------------------------------------------------
| Data descriptors inherited from abc.AbstractBase:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class BlockingConnection(builtins.object)
| BlockingConnection(parameters: 'Optional[Union[pika.connection.Parameters, Sequence[pika.connection.Parameters]]]' = None, _impl_class: 'Optional[select_connection.SelectConnection]' = None) -> 'None'
|
| The BlockingConnection creates a layer on top of Pika's asynchronous core
| providing methods that will block until their expected response has
| returned. Due to the asynchronous nature of the `Basic.Deliver` and
| `Basic.Return` calls from RabbitMQ to your application, you can still
| implement continuation-passing style asynchronous methods if you'd like to
| receive messages from RabbitMQ using
| :meth:`basic_consume <BlockingChannel.basic_consume>` or if you want to be
| notified of a delivery failure when using
| :meth:`basic_publish <BlockingChannel.basic_publish>`.
|
| For more information about communicating with the blocking_connection
| adapter, be sure to check out the
| :class:`BlockingChannel <BlockingChannel>` class which implements the
| :class:`Channel <pika.channel.Channel>` based communication for the
| blocking_connection adapter.
|
| To prevent recursion/reentrancy, the blocking connection and channel
| implementations queue asynchronously-delivered events received
| in nested context (e.g., while waiting for `BlockingConnection.channel` or
| `BlockingChannel.queue_declare` to complete), dispatching them synchronously
| once nesting returns to the desired context. This concerns all callbacks,
| such as those registered via `BlockingConnection.call_later`,
| `BlockingConnection.add_on_connection_blocked_callback`,
| `BlockingConnection.add_on_connection_unblocked_callback`,
| `BlockingChannel.basic_consume`, etc.
|
| Blocked Connection deadlock avoidance: when RabbitMQ becomes low on
| resources, it emits Connection.Blocked (AMQP extension) to the client
| connection when client makes a resource-consuming request on that connection
| or its channel (e.g., `Basic.Publish`); subsequently, RabbitMQ suspsends
| processing requests from that connection until the affected resources are
| restored. See https://www.rabbitmq.com/connection-blocked.html. This
| may impact `BlockingConnection` and `BlockingChannel` operations in a
| way that users might not be expecting. For example, if the user dispatches
| `BlockingChannel.basic_publish` in non-publisher-confirmation mode while
| RabbitMQ is in this low-resource state followed by a synchronous request
| (e.g., `BlockingConnection.channel`, `BlockingChannel.consume`,
| `BlockingChannel.basic_consume`, etc.), the synchronous request will block
| indefinitely (until Connection.Unblocked) waiting for RabbitMQ to reply. If
| the blocked state persists for a long time, the blocking operation will
| appear to hang. In this state, `BlockingConnection` instance and its
| channels will not dispatch user callbacks. SOLUTION: To break this potential
| deadlock, applications may configure the `blocked_connection_timeout`
| connection parameter when instantiating `BlockingConnection`. Upon blocked
| connection timeout, this adapter will raise ConnectionBlockedTimeout
| exception`. See `pika.connection.ConnectionParameters` documentation to
| learn more about the `blocked_connection_timeout` configuration.
|
| Methods defined here:
|
| __enter__(self) -> 'BlockingConnection'
|
| __exit__(self, exc_type: 'Exception', value: 'TracebackException', traceback: 'TracebackType') -> 'None'
|
| __init__(self, parameters: 'Optional[Union[pika.connection.Parameters, Sequence[pika.connection.Parameters]]]' = None, _impl_class: 'Optional[select_connection.SelectConnection]' = None) -> '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.
| :param _impl_class: for tests/debugging only; implementation class;
| None=default
|
| :raises RuntimeError:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| add_callback_threadsafe(self, callback: 'Callable[..., None]') -> 'None'
| Requests a call to the given function as soon as possible in the
| context of this connection's thread.
|
| NOTE: This is the only thread-safe method in `BlockingConnection`. All
| other manipulations of `BlockingConnection` must be performed from the
| connection's thread.
|
| NOTE: the callbacks are dispatched only in the scope of
| specially-designated methods: see
| `BlockingConnection.process_data_events()` and
| `BlockingChannel.start_consuming()`.
|
| For example, a thread may request a call to the
| `BlockingChannel.basic_ack` method of a `BlockingConnection` that is
| running in a different thread via::
|
| connection.add_callback_threadsafe(
| functools.partial(channel.basic_ack, delivery_tag=...))
|
| NOTE: if you know that the requester is running on the same thread as
| the connection it is more efficient to use the
| `BlockingConnection.call_later()` method with a delay of 0.
|
| :param callable callback: The callback method; must be callable
| :raises pika.exceptions.ConnectionWrongStateError: if connection is
| closed
|
| add_on_connection_blocked_callback(self, callback: 'Callable[[pika.connection.Connection, pika.frame.Method[pika.spec.Connection.Blocked]], None]') -> 'None'
| RabbitMQ AMQP extension - Add a callback to be notified when the
| connection gets blocked (`Connection.Blocked` received from RabbitMQ)
| due to the broker running low on resources (memory or disk). In this
| state RabbitMQ suspends processing incoming data until the connection
| is unblocked, so it's a good idea for publishers receiving this
| notification to suspend publishing until the connection becomes
| unblocked.
|
| NOTE: due to the blocking nature of BlockingConnection, if it's sending
| outbound data while the connection is/becomes blocked, the call may
| remain blocked until the connection becomes unblocked, if ever. You
| may use `ConnectionParameters.blocked_connection_timeout` to abort a
| BlockingConnection method call with an exception when the connection
| remains blocked longer than the given timeout value.
|
| See also `Connection.add_on_connection_unblocked_callback()`
|
| See also `ConnectionParameters.blocked_connection_timeout`.
|
| :param callable callback: Callback to call on `Connection.Blocked`,
| having the signature `callback(connection, pika.frame.Method)`,
| where connection is the `BlockingConnection` instance and the method
| frame's `method` member is of type `pika.spec.Connection.Blocked`
|
| add_on_connection_unblocked_callback(self, callback: 'Callable[[pika.connection.Connection, pika.frame.Method[pika.spec.Connection.Unblocked]], None]') -> 'None'
| RabbitMQ AMQP extension - Add a callback to be notified when the
| connection gets unblocked (`Connection.Unblocked` frame is received from
| RabbitMQ) letting publishers know it's ok to start publishing again.
|
| :param callable callback: Callback to call on Connection.Unblocked`,
| having the signature `callback(connection, pika.frame.Method)`,
| where connection is the `BlockingConnection` instance and the method
| frame's `method` member is of type `pika.spec.Connection.Unblocked`
|
| call_later(self, delay: 'float', callback: 'Callable[[], None]') -> 'int'
| Create a single-shot timer to fire after delay seconds. Do not
| confuse with Tornado's timeout where you pass in the time you want to
| have your callback called. Only pass in the seconds until it's to be
| called.
|
| NOTE: the timer callbacks are dispatched only in the scope of
| specially-designated methods: see
| `BlockingConnection.process_data_events()` and
| `BlockingChannel.start_consuming()`.
|
| :param float delay: The number of seconds to wait to call callback
| :param callable callback: The callback method with the signature
| callback()
| :returns: Opaque timer id
| :rtype: int
|
| channel(self, channel_number: 'Optional[int]' = None) -> 'BlockingChannel'
| Create a new channel with the next available channel number or pass
| in a channel number to use. Must be non-zero if you would like to
| specify but it is recommended that you let Pika manage the channel
| numbers.
|
| :rtype: pika.adapters.blocking_connection.BlockingChannel
|
| close(self, reply_code: 'int' = 200, reply_text: 'str' = 'Normal shutdown') -> 'None'
| Disconnect from RabbitMQ. If there are any open channels, it will
| attempt to close them prior to fully disconnecting. Channels which
| have active consumers will attempt to send a Basic.Cancel to RabbitMQ
| to cleanly stop the delivery of messages prior to closing the channel.
|
| :param int reply_code: The code number for the close
| :param str reply_text: The text reason for the close
|
| :raises pika.exceptions.ConnectionWrongStateError: if called on a closed
| connection (NEW in v1.0.0)
|
| process_data_events(self, time_limit: 'Optional[float]' = 0) -> 'None'
| Will make sure that data events are processed. Dispatches timer and
| channel callbacks if not called from the scope of BlockingConnection or
| BlockingChannel callback. Your app can block on this method. If your
| application maintains a long-lived publisher connection, this method
| should be called periodically in order to respond to heartbeats and other
| data events. See `examples/long_running_publisher.py` for an example.
|
| :param float time_limit: suggested upper bound on processing time in
| seconds. The actual blocking time depends on the granularity of the
| underlying ioloop. Zero means return as soon as possible. None means
| there is no limit on processing time and the function will block
| until I/O produces actionable events. Defaults to 0 for backward
| compatibility. This parameter is NEW in pika 0.10.0.
|
| remove_timeout(self, timeout_id: 'int') -> 'None'
| Remove a timer if it's still in the timeout stack
|
| :param timeout_id: The opaque timer id to remove
|
| sleep(self, duration: 'float') -> 'None'
| A safer way to sleep than calling time.sleep() directly that would
| keep the adapter from ignoring frames sent from the broker. The
| connection will "sleep" or block the number of seconds specified in
| duration in small intervals.
|
| :param float duration: The time to sleep in seconds
|
| update_secret(self, new_secret: 'str', reason: 'str') -> 'None'
| RabbitMQ AMQP extension - This method updates the secret used to authenticate this connection.
| It is used when secrets have an expiration date and need to be renewed, like OAuth 2 tokens.
|
| :param string new_secret: The new secret
| :param string reason: The reason for the secret update
|
| :raises pika.exceptions.ConnectionWrongStateError: if connection is
| not open.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| basic_nack
| Specifies if the server supports basic.nack on the active connection.
|
| :rtype: bool
|
| basic_nack_supported
| Specifies if the server supports basic.nack on the active connection.
|
| :rtype: bool
|
| consumer_cancel_notify
| Specifies if the server supports consumer cancel notification on the
| active connection.
|
| :rtype: bool
|
| consumer_cancel_notify_supported
| Specifies if the server supports consumer cancel notification on the
| active connection.
|
| :rtype: bool
|
| exchange_exchange_bindings
| Specifies if the active connection supports exchange to exchange
| bindings.
|
| :rtype: bool
|
| exchange_exchange_bindings_supported
| Specifies if the active connection supports exchange to exchange
| bindings.
|
| :rtype: bool
|
| is_closed
| Returns a boolean reporting the current connection state.
|
| is_open
| Returns a boolean reporting the current connection state.
|
| publisher_confirms
| Specifies if the active connection can use publisher confirmations.
|
| :rtype: bool
|
| publisher_confirms_supported
| Specifies if the active connection can use publisher confirmations.
|
| :rtype: bool
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class IOLoop(pika.adapters.utils.selector_ioloop_adapter.AbstractSelectorIOLoop)
| IOLoop() -> 'None'
|
| I/O loop implementation that picks a suitable poller (`select`,
| `poll`, `epoll`, `kqueue`) to use based on platform.
|
| Implements the
| `pika.adapters.utils.selector_ioloop_adapter.AbstractSelectorIOLoop`
| interface.
|
| Method resolution order:
| IOLoop
| pika.adapters.utils.selector_ioloop_adapter.AbstractSelectorIOLoop
| builtins.object
|
| Methods defined here:
|
| __init__(self) -> 'None'
| Initialize self. See help(type(self)) for accurate signature.
|
| activate_poller(self) -> 'None'
| [Extension] Activate the poller
|
| add_callback = add_callback_threadsafe(self, callback: 'Callable[[], None]') -> 'None'
|
| add_callback_threadsafe(self, callback: 'Callable[[], None]') -> 'None'
| Requests a call to the given function as soon as possible in the
| context of this IOLoop's thread.
|
| NOTE: This is the only thread-safe method in IOLoop. All other
| manipulations of IOLoop must be performed from the IOLoop's thread.
|
| For example, a thread may request a call to the `stop` method of an
| ioloop that is running in a different thread via
| `ioloop.add_callback_threadsafe(ioloop.stop)`
|
| :param callable callback: The callback method
|
| add_handler(self, fd: 'int', handler: 'Callable[[int, int], None]', events: 'int') -> 'None'
| Start watching the given file descriptor for events
|
| :param int fd: The file descriptor
| :param callable handler: When requested event(s) occur,
| `handler(fd, events)` will be called.
| :param int events: The event mask using READ, WRITE, ERROR.
|
| call_later(self, delay: 'float', callback: 'Callable[[], None]') -> '_Timeout'
| Add the callback to the IOLoop timer to be called after delay seconds
| from the time of call on best-effort basis. Returns a handle to the
| timeout.
|
| :param float delay: The number of seconds to wait to call callback
| :param callable callback: The callback method
| :returns: handle to the created timeout that may be passed to
| `remove_timeout()`
| :rtype: object
|
| close(self) -> 'None'
| Release IOLoop's resources.
|
| `IOLoop.close` is intended to be called by the application or test code
| only after `IOLoop.start()` returns. After calling `close()`, no other
| interaction with the closed instance of `IOLoop` should be performed.
|
| deactivate_poller(self) -> 'None'
| [Extension] Deactivate the poller
|
| poll(self) -> 'None'
| [Extension] Wait for events of interest on registered file
| descriptors until an event of interest occurs or next timer deadline or
| `_PollerBase._MAX_POLL_TIMEOUT`, whichever is sooner, and dispatch the
| corresponding event handlers.
|
| process_timeouts(self) -> 'None'
| [Extension] Process pending callbacks and timeouts, invoking those
| whose time has come. Internal use only.
|
| remove_handler(self, fd: 'int') -> 'None'
| Stop watching the given file descriptor for events
|
| :param int fd: The file descriptor
|
| remove_timeout(self, timeout_handle: '_Timeout') -> 'None'
| Remove a timeout
|
| :param timeout_handle: Handle of timeout to remove
|
| start(self) -> 'None'
| [API] Start the main poller loop. It will loop until requested to
| exit. See `IOLoop.stop`.
|
| stop(self) -> 'None'
| [API] Request exit from the ioloop. The loop is NOT guaranteed to
| stop before this method returns.
|
| To invoke `stop()` safely from a thread other than this IOLoop's thread,
| call it via `add_callback_threadsafe`; e.g.,
|
| `ioloop.add_callback_threadsafe(ioloop.stop)`
|
| update_handler(self, fd: 'int', events: 'int') -> 'None'
| Changes the events we watch for
|
| :param int fd: The file descriptor
| :param int events: The event mask using READ, WRITE, ERROR
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| ERROR = 8
|
| READ = 1
|
| WRITE = 4
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pika.adapters.utils.selector_ioloop_adapter.AbstractSelectorIOLoop:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class SelectConnection(pika.adapters.base_connection.BaseConnection)
| SelectConnection(parameters: 'Optional[connection.Parameters]' = None, on_open_callback: 'Optional[Callable[[connection.Connection], None]]' = None, on_open_error_callback: 'Optional[Callable[[connection.Connection, BaseException], None]]' = None, on_close_callback: 'Optional[Callable[[connection.Connection, BaseException], None]]' = None, custom_ioloop: 'Optional[Union[nbio_interface.AbstractIOServices, IOLoop]]' = None, internal_connection_workflow: 'bool' = True) -> 'None'
|
| An asynchronous connection adapter that attempts to use the fastest
| event loop adapter for the given platform.
|
| Method resolution order:
| SelectConnection
| pika.adapters.base_connection.BaseConnection
| pika.connection.Connection
| abc.AbstractBase
| builtins.object
|
| Methods defined here:
|
| __init__(self, parameters: 'Optional[connection.Parameters]' = None, on_open_callback: 'Optional[Callable[[connection.Connection], None]]' = None, on_open_error_callback: 'Optional[Callable[[connection.Connection, BaseException], None]]' = None, on_close_callback: 'Optional[Callable[[connection.Connection, BaseException], None]]' = None, custom_ioloop: 'Optional[Union[nbio_interface.AbstractIOServices, IOLoop]]' = None, internal_connection_workflow: 'bool' = True) -> 'None'
| Create a new instance of the Connection object.
|
| :param pika.connection.Parameters parameters: Connection parameters
| :param callable on_open_callback: Method to call on connection open
| :param None | method on_open_error_callback: Called if the connection
| can't be established or connection establishment is interrupted by
| `Connection.close()`: on_open_error_callback(Connection, exception).
| :param None | method on_close_callback: Called when a previously fully
| open connection is closed:
| `on_close_callback(Connection, exception)`, where `exception` is
| either an instance of `exceptions.ConnectionClosed` if closed by
| user or broker or exception of another type that describes the cause
| of connection failure.
| :param None | IOLoop | nbio_interface.AbstractIOServices custom_ioloop:
| Provide a custom I/O Loop object.
| :param bool internal_connection_workflow: True for autonomous connection
| establishment which is default; False for externally-managed
| connection workflow via the `create_connection()` factory.
| :raises: RuntimeError
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| create_connection(connection_configs: 'Sequence[connection.Parameters]', on_done: 'Callable[[Union[connection.Connection, connection_workflow.AMQPConnectorException]], None]', custom_ioloop: 'Optional[Any]' = None, workflow: 'Optional[connection_workflow.AbstractAMQPConnectionWorkflow]' = None) -> 'connection_workflow.AbstractAMQPConnectionWorkflow'
| Implement
| :py:classmethod::`pika.adapters.BaseConnection.create_connection()`.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __abstractmethods__ = frozenset()
|
| ----------------------------------------------------------------------
| Methods inherited from pika.adapters.base_connection.BaseConnection:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Readonly properties inherited from pika.adapters.base_connection.BaseConnection:
|
| ioloop
| :returns: the native I/O loop instance underlying async services selected
| by user or the default selected by the specialized connection
| adapter (e.g., Twisted reactor, `asyncio.SelectorEventLoop`,
| `select_connection.IOLoop`, etc.)
| :rtype: object
|
| ----------------------------------------------------------------------
| Methods inherited from pika.connection.Connection:
|
| add_on_close_callback(self, callback: 'Callable[[Connection, Exception], Any]') -> 'None'
| Add a callback notification when the connection has closed. The
| callback will be passed the connection and an exception instance. The
| exception will either be an instance of `exceptions.ConnectionClosed` if
| a fully-open connection was closed by user or broker or exception of
| another type that describes the cause of connection closure/failure.
|
| :param callable callback: Callback to call on close, having the signature:
| callback(pika.connection.Connection, exception)
|
| add_on_connection_blocked_callback(self, callback: 'Callable[[Connection, frame.Method[spec.Connection.Blocked]], Any]') -> 'None'
| RabbitMQ AMQP extension - Add a callback to be notified when the
| connection gets blocked (`Connection.Blocked` received from RabbitMQ)
| due to the broker running low on resources (memory or disk). In this
| state RabbitMQ suspends processing incoming data until the connection
| is unblocked, so it's a good idea for publishers receiving this
| notification to suspend publishing until the connection becomes
| unblocked.
|
| See also `Connection.add_on_connection_unblocked_callback()`
|
| See also `ConnectionParameters.blocked_connection_timeout`.
|
| :param callable callback: Callback to call on `Connection.Blocked`,
| having the signature `callback(connection, pika.frame.Method)`,
| where the method frame's `method` member is of type
| `pika.spec.Connection.Blocked`
|
| add_on_connection_unblocked_callback(self, callback: 'Callable[[Connection, frame.Method[spec.Connection.Unblocked]], Any]') -> 'None'
| RabbitMQ AMQP extension - Add a callback to be notified when the
| connection gets unblocked (`Connection.Unblocked` frame is received from
| RabbitMQ) letting publishers know it's ok to start publishing again.
|
| :param callable callback: Callback to call on
| `Connection.Unblocked`, having the signature
| `callback(connection, pika.frame.Method)`, where the method frame's
| `method` member is of type `pika.spec.Connection.Unblocked`
|
| add_on_open_callback(self, callback: 'Callable[[Connection], Any]') -> 'None'
| Add a callback notification when the connection has opened. The
| callback will be passed the connection instance as its only arg.
|
| :param callable callback: Callback to call when open
|
| add_on_open_error_callback(self, callback: 'Callable[[Connection, Optional[BaseException]], Any]', remove_default: 'bool' = True) -> 'None'
| Add a callback notification when the connection can not be opened.
|
| The callback method should accept the connection instance that could not
| connect, and either a string or an exception as its second arg.
|
| :param callable callback: Callback to call when can't connect, having
| the signature _(Connection, Exception)
| :param bool remove_default: Remove default exception raising callback
|
| channel(self, channel_number: 'Optional[int]' = None, on_open_callback: 'Optional[Callable[[Channel], Any]]' = None) -> 'Channel'
| Create a new channel with the next available channel number or pass
| in a channel number to use. Must be non-zero if you would like to
| specify but it is recommended that you let Pika manage the channel
| numbers.
|
| :param int channel_number: The channel number to use, defaults to the
| next available.
| :param callable on_open_callback: The callback when the channel is
| opened. The callback will be invoked with the `Channel` instance
| as its only argument.
| :rtype: pika.channel.Channel
|
| close(self, reply_code: 'int' = 200, reply_text: 'str' = 'Normal shutdown') -> 'None'
| Disconnect from RabbitMQ. If there are any open channels, it will
| attempt to close them prior to fully disconnecting. Channels which
| have active consumers will attempt to send a Basic.Cancel to RabbitMQ
| to cleanly stop the delivery of messages prior to closing the channel.
|
| :param int reply_code: The code number for the close
| :param str reply_text: The text reason for the close
|
| :raises pika.exceptions.ConnectionWrongStateError: if connection is
| closed or closing.
|
| update_secret(self, new_secret: 'str', reason: 'str', callback: 'Optional[Callable[[frame.Method[spec.Connection.UpdateSecretOk]], Any]]' = None) -> 'None'
| RabbitMQ AMQP extension - This method updates the secret used to authenticate this connection.
| It is used when secrets have an expiration date and need to be renewed, like OAuth 2 tokens.
| Pass a callback to be notified of the response from the server.
|
| :param string new_secret: The new secret
| :param string reason: The reason for the secret update
| :param callable callback: Callback to call on
| `Connection.UpdateSecretOk`, having the signature
| `callback(pika.frame.Method)`, where the method frame's
| `method` member is of type `pika.spec.Connection.UpdateSecretOk`
|
| :raises pika.exceptions.ConnectionWrongStateError: if connection is
| not open.
|
| ----------------------------------------------------------------------
| Readonly properties inherited from pika.connection.Connection:
|
| basic_nack
| Specifies if the server supports basic.nack on the active connection.
|
| :rtype: bool
|
| consumer_cancel_notify
| Specifies if the server supports consumer cancel notification on the
| active connection.
|
| :rtype: bool
|
| exchange_exchange_bindings
| Specifies if the active connection supports exchange to exchange
| bindings.
|
| :rtype: bool
|
| is_closed
| Returns a boolean reporting the current connection state.
|
| is_closing
| Returns True if connection is in the process of closing due to
| client-initiated `close` request, but closing is not yet complete.
|
| is_open
| Returns a boolean reporting the current connection state.
|
| publisher_confirms
| Specifies if the active connection can use publisher confirmations.
|
| :rtype: bool
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from pika.connection.Connection:
|
| CONNECTION_CLOSED = 0
|
| CONNECTION_CLOSING = 6
|
| CONNECTION_INIT = 1
|
| CONNECTION_OPEN = 5
|
| CONNECTION_PROTOCOL = 2
|
| CONNECTION_START = 3
|
| CONNECTION_TUNE = 4
|
| ON_CONNECTION_CLOSED = '_on_connection_closed'
|
| ON_CONNECTION_ERROR = '_on_connection_error'
|
| ON_CONNECTION_OPEN_OK = '_on_connection_open_ok'
|
| ----------------------------------------------------------------------
| Data descriptors inherited from abc.AbstractBase:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
DATA
__all__ = ['AsyncioConnection', 'BaseConnection', 'BlockingConnection'...
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pika\adapters\__init__.py
pika.amqp_object
Python Library Documentation: module pika.amqp_object in pika
NAME
pika.amqp_object
DESCRIPTION
Base classes that are extended by low level AMQP frames and higher level
AMQP classes and methods.
CLASSES
builtins.object
AMQPObject
Class
Method
Properties
class AMQPObject(builtins.object)
| Base object that is extended by AMQP low level frames and AMQP classes
| and methods.
|
| Methods defined here:
|
| __eq__(self, other: 'object') -> 'bool'
| Return self==value.
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| INDEX = None
|
| NAME = 'AMQPObject'
|
| __annotations__ = {'INDEX': 'int | None', 'NAME': 'str'}
|
| __hash__ = None
class Class(AMQPObject)
| Is extended by AMQP classes
|
| Method resolution order:
| Class
| AMQPObject
| builtins.object
|
| Data and other attributes defined here:
|
| NAME = 'Unextended Class'
|
| __annotations__ = {'NAME': 'str'}
|
| ----------------------------------------------------------------------
| Methods inherited from AMQPObject:
|
| __eq__(self, other: 'object') -> 'bool'
| Return self==value.
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPObject:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from AMQPObject:
|
| INDEX = None
|
| __hash__ = None
class Method(AMQPObject)
| Is extended by AMQP methods
|
| Method resolution order:
| Method
| AMQPObject
| builtins.object
|
| Methods defined here:
|
| decode(self, encoded: 'bytes', offset: 'int' = 0) -> 'Method'
| Decode the method from a binary format.
|
| :param bytes encoded: The encoded method data
| :param int offset: The offset to start decoding from
|
| :rtype: Method
|
| encode(self) -> 'List[bytes]'
| Encode the method into a binary format.
|
| :rtype: List[bytes]
|
| get_body(self) -> 'bytes'
| Return the message body if it is set.
|
| :rtype: str|unicode
|
| get_properties(self) -> 'Properties'
| Return the properties if they are set.
|
| :rtype: pika.frame.Properties
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| NAME = 'Unextended Method'
|
| __annotations__ = {'NAME': 'str', 'synchronous': 'bool'}
|
| synchronous = False
|
| ----------------------------------------------------------------------
| Methods inherited from AMQPObject:
|
| __eq__(self, other: 'object') -> 'bool'
| Return self==value.
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPObject:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from AMQPObject:
|
| INDEX = None
|
| __hash__ = None
class Properties(AMQPObject)
| Class to encompass message properties (AMQP Basic.Properties)
|
| Method resolution order:
| Properties
| AMQPObject
| builtins.object
|
| Data and other attributes defined here:
|
| NAME = 'Unextended Properties'
|
| __annotations__ = {'NAME': 'str'}
|
| ----------------------------------------------------------------------
| Methods inherited from AMQPObject:
|
| __eq__(self, other: 'object') -> 'bool'
| Return self==value.
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPObject:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from AMQPObject:
|
| INDEX = None
|
| __hash__ = None
DATA
List = typing.List
A generic version of list.
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pika\amqp_object.py
pika.callback
Python Library Documentation: module pika.callback in pika
NAME
pika.callback
DESCRIPTION
Callback management class, common area for keeping track of all callbacks in
the Pika stack.
CLASSES
builtins.object
CallbackManager
class CallbackManager(builtins.object)
| CallbackManager() -> 'None'
|
| CallbackManager is a global callback system designed to be a single place
| where Pika can manage callbacks and process them. It should be referenced
| by the CallbackManager.instance() method instead of constructing new
| instances of it.
|
| Methods defined here:
|
| __init__(self) -> 'None'
| Create an instance of the CallbackManager
|
| add(self, prefix: '_Prefix', key: 'AMQPValue', callback: 'Callable[..., Any]', one_shot: 'bool' = True, only_caller: 'Optional[_Caller]' = None, arguments: 'Optional[Dict[str, Any]]' = None) -> 'Tuple[_Prefix, Any]'
| Add a callback to the stack for the specified key. If the call is
| specified as one_shot, it will be removed after being fired
|
| The prefix is usually the channel number but the class is generic
| and prefix and key may be any value. If you pass in only_caller
| CallbackManager will restrict processing of the callback to only
| the calling function/object that you specify.
|
| :param str|int prefix: Categorize the callback
| :param str|dict key: The key for the callback
| :param callable callback: The callback to call
| :param bool one_shot: Remove this callback after it is called
| :param object only_caller: Only allow one_caller value to call the
| event that fires the callback.
| :param dict arguments: Arguments to validate when processing
| :rtype: tuple(prefix, key)
|
| cleanup(self, prefix: '_Prefix') -> 'bool'
| Remove all callbacks from the stack by a prefix. Returns True
| if keys were there to be removed
|
| :param str or int prefix: The prefix for keeping track of callbacks with
| :rtype: bool
|
| clear(self) -> 'None'
| Clear all the callbacks if there are any defined.
|
| pending(self, prefix: '_Prefix', key: 'AMQPValue') -> 'Optional[int]'
| Return count of callbacks for a given prefix or key or None
|
| :param str|int prefix: Categorize the callback
| :param object|str|int key: The key for the callback
| :rtype: None or int
|
| process(self, prefix: '_Prefix', key: 'AMQPValue', caller: '_Caller', *args: 'Any', **keywords: 'Any') -> 'bool'
| Run through and process all the callbacks for the specified keys.
| Caller should be specified at all times so that callbacks which
| require a specific function to call CallbackManager.process will
| not be processed.
|
| :param str|int prefix: Categorize the callback
| :param object|str|int key: The key for the callback
| :param object caller: Who is firing the event
| :param list args: Any optional arguments
| :param dict keywords: Optional keyword arguments
| :rtype: bool
|
| remove(self, prefix: '_Prefix', key: 'AMQPValue', callback_value: 'Optional[Callable[..., Any]]' = None, arguments: 'Optional[Dict[str, Any]]' = None) -> 'bool'
| Remove a callback from the stack by prefix, key and optionally
| the callback itself. If you only pass in prefix and key, all
| callbacks for that prefix and key will be removed.
|
| :param str or int prefix: The prefix for keeping track of callbacks with
| :param str key: The callback key
| :param callable callback_value: The method defined to call on callback
| :param dict arguments: Optional arguments to check
| :rtype: bool
|
| remove_all(self, prefix: '_Prefix', key: 'AMQPValue') -> 'None'
| Remove all callbacks for the specified prefix and key.
|
| :param str prefix: The prefix for keeping track of callbacks with
| :param str key: The callback key
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| ARGUMENTS = 'arguments'
|
| CALLBACK = 'callback'
|
| CALLS = 'calls'
|
| DUPLICATE_WARNING = 'Duplicate callback found for "%s:%s"'
|
| ONE_SHOT = 'one_shot'
|
| ONLY_CALLER = 'only'
|
| __annotations__ = {'ARGUMENTS': 'str', 'CALLBACK': 'str', 'CALLS': 'st...
FUNCTIONS
check_for_prefix_and_key(function: '_Callback') -> '_Callback'
Automatically return false if the key or prefix is not in the callbacks
for the instance.
name_or_value(value: 'AMQPValue') -> 'str'
Will take Frame objects, classes, etc and attempt to return a valid
string identifier for them.
:param pika.amqp_object.AMQPObject|pika.frame.Frame|int|str value: The
value to sanitize
:rtype: str
sanitize_prefix(function: '_Callback') -> '_Callback'
Automatically call name_or_value on the prefix passed in.
DATA
AMQPValue = typing.Union[typing.Type[pika.amqp_object.AMQPObject], pik...
Callable = typing.Callable
Deprecated alias to collections.abc.Callable.
Callable[[int], str] signifies a function that takes a single
parameter of type int and returns a str.
The subscription syntax must always be used with exactly two
values: the argument list and the return type.
The argument list must be a list of types, a ParamSpec,
Concatenate or ellipsis. The return type must be a single type.
There is no syntax to indicate optional or keyword arguments;
such function types are rarely used as callback types.
Dict = typing.Dict
A generic version of dict.
LOGGER = <Logger pika.callback (WARNING)>
List = typing.List
A generic version of list.
Optional = typing.Optional
Optional[X] is equivalent to Union[X, None].
Tuple = typing.Tuple
Deprecated alias to builtins.tuple.
Tuple[X, Y] is the cross-product type of X and Y.
Example: Tuple[T1, T2] is a tuple of two elements corresponding
to type variables T1 and T2. Tuple[int, float, str] is a tuple
of an int, a float and a string.
To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
Type = typing.Type
Deprecated alias to builtins.type.
builtins.type or typing.Type can be used to annotate class objects.
For example, suppose we have the following classes::
class User: ... # Abstract base for User classes
class BasicUser(User): ...
class ProUser(User): ...
class TeamUser(User): ...
And a function that takes a class argument that's a subclass of
User and returns an instance of the corresponding class::
def new_user[U](user_class: Type[U]) -> U:
user = user_class()
# (Here we could write the user object to a database)
return user
joe = new_user(BasicUser)
At this point the type checker knows that joe has type BasicUser.
Union = typing.Union
Union type; Union[X, Y] means either X or Y.
On Python 3.10 and higher, the | operator
can also be used to denote unions;
X | Y means the same thing to the type checker as Union[X, Y].
To define a union, use e.g. Union[int, str]. Details:
- The arguments must be types and there must be at least one.
- None as an argument is a special case and is replaced by
type(None).
- Unions of unions are flattened, e.g.::
assert Union[Union[int, str], float] == Union[int, str, float]
- Unions of a single argument vanish, e.g.::
assert Union[int] == int # The constructor actually returns int
- Redundant arguments are skipped, e.g.::
assert Union[int, str, int] == Union[int, str]
- When comparing unions, the argument order is ignored, e.g.::
assert Union[int, str] == Union[str, int]
- You cannot subclass or instantiate a union.
- You can use Optional[X] as a shorthand for Union[X, None].
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pika\callback.py
pika.channel
Python Library Documentation: module pika.channel in pika
NAME
pika.channel
DESCRIPTION
The Channel class provides a wrapper for interacting with RabbitMQ
implementing the methods and behaviors for an AMQP Channel.
CLASSES
builtins.object
Channel
ContentFrameAssembler
class Channel(builtins.object)
| Channel(connection: 'Connection', channel_number: 'int', on_open_callback: 'Optional[_OnOpenCallback]') -> 'None'
|
| A Channel is the primary communication method for interacting with
| RabbitMQ. It is recommended that you do not directly invoke the creation of
| a channel object in your application code but rather construct a channel by
| calling the active connection's channel() method.
|
| Methods defined here:
|
| __init__(self, connection: 'Connection', channel_number: 'int', on_open_callback: 'Optional[_OnOpenCallback]') -> 'None'
| Create a new instance of the Channel
|
| :param pika.connection.Connection connection: The connection
| :param int channel_number: The channel number for this instance
| :param callable on_open_callback: The callback to call on channel open.
| The callback will be invoked with the `Channel` instance as its only
| argument.
|
| __int__(self) -> 'int'
| Return the channel object as its channel number
|
| :rtype: int
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| add_callback(self, callback: 'Callable[..., Any]', replies: 'Sequence[Type[amqp_object.Method]]', one_shot: 'bool' = True) -> 'None'
| Pass in a callback handler and a list replies from the
| RabbitMQ broker which you'd like the callback notified of. Callbacks
| should allow for the frame parameter to be passed in.
|
| :param callable callback: The callback to call
| :param list replies: The replies to get a callback for
| :param bool one_shot: Only handle the first type callback
|
| add_on_cancel_callback(self, callback: '_OnCancelCallback') -> 'None'
| Pass a callback function that will be called when the basic_cancel
| is sent by the server. The callback function should receive a frame
| parameter.
|
| :param callable callback: The callback to call on Basic.Cancel from
| broker
|
| add_on_close_callback(self, callback: '_OnCloseCallback') -> 'None'
| Pass a callback function that will be called when the channel is
| closed. The callback function will receive the channel and an exception
| describing why the channel was closed.
|
| If the channel is closed by broker via Channel.Close, the callback will
| receive `ChannelClosedByBroker` as the reason.
|
| If graceful user-initiated channel closing completes successfully (
| either directly of indirectly by closing a connection containing the
| channel) and closing concludes gracefully without Channel.Close from the
| broker and without loss of connection, the callback will receive
| `ChannelClosedByClient` exception as reason.
|
| If channel was closed due to loss of connection, the callback will
| receive another exception type describing the failure.
|
| :param callable callback: The callback, having the signature:
| callback(Channel, Exception reason)
|
| add_on_flow_callback(self, callback: '_OnFlowCallback') -> 'None'
| Pass a callback function that will be called when Channel.Flow is
| called by the remote server. Note that newer versions of RabbitMQ
| will not issue this but instead use TCP backpressure
|
| :param callable callback: The callback function
|
| add_on_return_callback(self, callback: '_OnReturnCallback') -> 'None'
| Pass a callback function that will be called when basic_publish is
| sent a message that has been rejected and returned by the server.
|
| :param callable callback: The function to call, having the signature
| callback(channel, method, properties, body)
| where
| - channel: pika.channel.Channel
| - method: pika.spec.Basic.Return
| - properties: pika.spec.BasicProperties
| - body: bytes
|
| basic_ack(self, delivery_tag: 'int' = 0, multiple: 'bool' = False) -> 'None'
| Acknowledge one or more messages. When sent by the client, this
| method acknowledges one or more messages delivered via the Deliver or
| Get-Ok methods. When sent by server, this method acknowledges one or
| more messages published with the Publish method on a channel in
| confirm mode. The acknowledgement can be for a single message or a
| set of messages up to and including a specific message.
|
| :param integer delivery_tag: int/long The server-assigned delivery tag
| :param bool multiple: If set to True, the delivery tag is treated as
| "up to and including", so that multiple messages
| can be acknowledged with a single method. If set
| to False, the delivery tag refers to a single
| message. If the multiple field is 1, and the
| delivery tag is zero, this indicates
| acknowledgement of all outstanding messages.
|
| basic_cancel(self, consumer_tag: 'str' = '', callback: 'Optional[_OnBasicCancelCallback]' = None) -> 'None'
| This method cancels a consumer. This does not affect already
| delivered messages, but it does mean the server will not send any more
| messages for that consumer. The client may receive an arbitrary number
| of messages in between sending the cancel method and receiving the
| cancel-ok reply. It may also be sent from the server to the client in
| the event of the consumer being unexpectedly cancelled (i.e. cancelled
| for any reason other than the server receiving the corresponding
| basic.cancel from the client). This allows clients to be notified of
| the loss of consumers due to events such as queue deletion.
|
| :param str consumer_tag: Identifier for the consumer
| :param callable callback: callback(pika.frame.Method) for method
| Basic.CancelOk. If None, do not expect a Basic.CancelOk response,
| otherwise, callback must be callable
|
| :raises ValueError:
|
| basic_consume(self, queue: 'str', on_message_callback: '_OnMessageCallback', auto_ack: 'bool' = False, exclusive: 'bool' = False, consumer_tag: 'Optional[str]' = None, arguments: 'Optional[Dict[str, Any]]' = None, callback: 'Optional[_OnBasicConsumeCallback]' = None) -> 'str'
| Sends the AMQP 0-9-1 command Basic.Consume to the broker and binds messages
| for the consumer_tag to the consumer callback. If you do not pass in
| a consumer_tag, one will be automatically generated for you. Returns
| the consumer tag.
|
| For more information on basic_consume, see:
| Tutorial 2 at https://www.rabbitmq.com/getstarted.html
| https://www.rabbitmq.com/confirms.html
| https://www.rabbitmq.com/amqp-0-9-1-reference.html#basic.consume
|
| :param str queue: The queue to consume from. Use the empty string to
| specify the most recent server-named queue for this channel
| :param callable on_message_callback: The function to call when
| consuming with the signature
| on_message_callback(channel, method, properties, body), where
| - channel: pika.channel.Channel
| - method: pika.spec.Basic.Deliver
| - properties: pika.spec.BasicProperties
| - body: bytes
| :param bool auto_ack: if set to True, automatic acknowledgement mode
| will be used (see https://www.rabbitmq.com/confirms.html).
| This corresponds with the 'no_ack' parameter in the basic.consume
| AMQP 0.9.1 method
| :param bool exclusive: Don't allow other consumers on the queue
| :param str consumer_tag: Specify your own consumer tag
| :param dict arguments: Custom key/value pair arguments for the consumer
| :param callable callback: callback(pika.frame.Method) for method
| Basic.ConsumeOk.
| :returns: Consumer tag which may be used to cancel the consumer.
| :rtype: str
| :raises ValueError:
|
| basic_get(self, queue: 'str', callback: '_OnBasicGetCallback', auto_ack: 'bool' = False) -> 'None'
| Get a single message from the AMQP broker. If you want to
| be notified of Basic.GetEmpty, use the Channel.add_callback method
| adding your Basic.GetEmpty callback which should expect only one
| parameter, frame. Due to implementation details, this cannot be called
| a second time until the callback is executed. For more information on
| basic_get and its parameters, see:
|
| https://www.rabbitmq.com/amqp-0-9-1-reference.html#basic.get
|
| :param str queue: The queue from which to get a message. Use the empty
| string to specify the most recent server-named queue for this
| channel
| :param callable callback: The callback to call with a message that has
| the signature callback(channel, method, properties, body), where:
| - channel: pika.channel.Channel
| - method: pika.spec.Basic.GetOk
| - properties: pika.spec.BasicProperties
| - body: bytes
| :param bool auto_ack: Tell the broker to not expect a reply
| :raises ValueError:
|
| basic_nack(self, delivery_tag: 'int' = 0, multiple: 'bool' = False, requeue: 'bool' = True) -> 'None'
| This method allows a client to reject one or more incoming messages.
| It can be used to interrupt and cancel large incoming messages, or
| return untreatable messages to their original queue.
|
| :param integer delivery_tag: int/long The server-assigned delivery tag
| :param bool multiple: If set to True, the delivery tag is treated as
| "up to and including", so that multiple messages
| can be acknowledged with a single method. If set
| to False, the delivery tag refers to a single
| message. If the multiple field is 1, and the
| delivery tag is zero, this indicates
| acknowledgement of all outstanding messages.
| :param bool requeue: If requeue is true, the server will attempt to
| requeue the message. If requeue is false or the
| requeue attempt fails the messages are discarded or
| dead-lettered.
|
| basic_publish(self, exchange: 'str', routing_key: 'str', body: 'bytes', properties: 'Optional[spec.BasicProperties]' = None, mandatory: 'bool' = False) -> 'None'
| Publish to the channel with the given exchange, routing key and body.
| For more information on basic_publish and what the parameters do, see:
|
| https://www.rabbitmq.com/amqp-0-9-1-reference.html#basic.publish
|
| :param str exchange: The exchange to publish to
| :param str routing_key: The routing key to bind on
| :param bytes body: The message body
| :param pika.spec.BasicProperties properties: Basic.properties
| :param bool mandatory: The mandatory flag
|
| basic_qos(self, prefetch_size: 'int' = 0, prefetch_count: 'int' = 0, global_qos: 'bool' = False, callback: 'Optional[_OnBasicQosCallback]' = None) -> 'None'
| Specify quality of service. This method requests a specific quality
| of service. The client can request that messages be sent in advance
| so that when the client finishes processing a message, the following
| message is already held locally, rather than needing to be sent down
| the channel. The QoS can be applied separately to each new consumer on
| channel or shared across all consumers on the channel. Prefetching
| gives a performance improvement.
|
| :param int prefetch_size: This field specifies the prefetch window
| size. The server will send a message in
| advance if it is equal to or smaller in size
| than the available prefetch size (and also
| falls into other prefetch limits). May be set
| to zero, meaning "no specific limit",
| although other prefetch limits may still
| apply. The prefetch-size is ignored by
| consumers who have enabled the no-ack option.
| :param int prefetch_count: Specifies a prefetch window in terms of whole
| messages. This field may be used in
| combination with the prefetch-size field; a
| message will only be sent in advance if both
| prefetch windows (and those at the channel
| and connection level) allow it. The
| prefetch-count is ignored by consumers who
| have enabled the no-ack option.
| :param bool global_qos: Should the QoS be shared across all
| consumers on the channel.
| :param callable callback: The callback to call for Basic.QosOk response
| :returns: ``None``. Method frame from the Basic.Qos-ok response is delivered
| to ``callback`` when provided.
| :raises ValueError:
|
| basic_recover(self, requeue: 'bool' = False, callback: 'Optional[_OnBasicRecoverCallback]' = None) -> 'None'
| This method asks the server to redeliver all unacknowledged messages
| on a specified channel. Zero or more messages may be redelivered. This
| method replaces the asynchronous Recover.
|
| :param bool requeue: If False, the message will be redelivered to the
| original recipient. If True, the server will
| attempt to requeue the message, potentially then
| delivering it to an alternative subscriber.
| :param callable callback: callback(pika.frame.Method) for method
| Basic.RecoverOk
| :returns: ``None``. Method frame from the Basic.Recover-ok response is
| delivered to ``callback`` when provided.
| :raises ValueError:
|
| basic_reject(self, delivery_tag: 'int' = 0, requeue: 'bool' = True) -> 'None'
| Reject an incoming message. This method allows a client to reject a
| message. It can be used to interrupt and cancel large incoming messages,
| or return untreatable messages to their original queue.
|
| :param integer delivery_tag: int/long The server-assigned delivery tag
| :param bool requeue: If requeue is true, the server will attempt to
| requeue the message. If requeue is false or the
| requeue attempt fails the messages are discarded or
| dead-lettered.
| :raises: TypeError
|
| close(self, reply_code: 'int' = 0, reply_text: 'str' = 'Normal shutdown') -> 'None'
| Invoke a graceful shutdown of the channel with the AMQP Broker.
|
| If channel is OPENING, transition to CLOSING and suppress the incoming
| Channel.OpenOk, if any.
|
| :param int reply_code: The reason code to send to broker
| :param str reply_text: The reason text to send to broker
|
| :raises ChannelWrongStateError: if channel is closed or closing
|
| confirm_delivery(self, ack_nack_callback: '_OnAckNackCallback', callback: 'Optional[_OnConfirmDeliveryCallback]' = None) -> 'None'
| Turn on Confirm mode in the channel. Pass in a callback to be
| notified by the Broker when a message has been confirmed as received or
| rejected (Basic.Ack, Basic.Nack) from the broker to the publisher.
|
| For more information see:
| https://www.rabbitmq.com/confirms.html
|
| :param callable ack_nack_callback: Required callback for delivery
| confirmations that has the following signature:
| callback(pika.frame.Method), where method_frame contains
| either method `spec.Basic.Ack` or `spec.Basic.Nack`.
| :param callable callback: callback(pika.frame.Method) for method
| Confirm.SelectOk
| :raises ValueError:
|
| exchange_bind(self, destination: 'str', source: 'str', routing_key: 'str' = '', arguments: 'Optional[Dict[str, Any]]' = None, callback: 'Optional[_OnExchangeBindCallback]' = None) -> 'None'
| Bind an exchange to another exchange.
|
| :param str destination: The destination exchange to bind
| :param str source: The source exchange to bind to
| :param str routing_key: The routing key to bind on
| :param dict arguments: Custom key/value pair arguments for the binding
| :param callable callback: callback(pika.frame.Method) for method Exchange.BindOk
| :returns: ``None``. Method frame from the Exchange.Bind-ok response is
| delivered to ``callback`` when synchronous (no ok frame in nowait
| mode).
| :raises ValueError:
|
| exchange_declare(self, exchange: 'str', exchange_type: 'str' = <ExchangeType.direct: 'direct'>, passive: 'bool' = False, durable: 'bool' = False, auto_delete: 'bool' = False, internal: 'bool' = False, arguments: 'Optional[Dict[str, Any]]' = None, callback: 'Optional[_OnExchangeDeclareCallback]' = None) -> 'None'
| This method creates an exchange if it does not already exist, and if
| the exchange exists, verifies that it is of the correct and expected
| class.
|
| If passive set, the server will reply with Declare-Ok if the exchange
| already exists with the same name, and raise an error if not and if the
| exchange does not already exist, the server MUST raise a channel
| exception with reply code 404 (not found).
|
| :param str exchange: The exchange name consists of a non-empty sequence
| of these characters: letters, digits, hyphen, underscore, period,
| or colon
| :param str exchange_type: The exchange type to use
| :param bool passive: Perform a declare or just check to see if it exists
| :param bool durable: Survive a reboot of RabbitMQ
| :param bool auto_delete: Remove when no more queues are bound to it
| :param bool internal: Can only be published to by other exchanges
| :param dict arguments: Custom key/value pair arguments for the exchange
| :param callable callback: callback(pika.frame.Method) for method Exchange.DeclareOk
| :returns: ``None``. Method frame from the Exchange.Declare-ok response is
| delivered to ``callback`` when synchronous (no ok frame in nowait
| mode).
| :raises ValueError:
|
| exchange_delete(self, exchange: 'Optional[str]' = None, if_unused: 'bool' = False, callback: 'Optional[_OnExchangeDeleteCallback]' = None) -> 'None'
| Delete the exchange.
|
| :param str exchange: The exchange name
| :param bool if_unused: only delete if the exchange is unused
| :param callable callback: callback(pika.frame.Method) for method Exchange.DeleteOk
| :returns: ``None``. Method frame from the Exchange.Delete-ok response is
| delivered to ``callback`` when synchronous (no ok frame in nowait
| mode).
| :raises ValueError:
|
| exchange_unbind(self, destination: 'Optional[str]' = None, source: 'Optional[str]' = None, routing_key: 'str' = '', arguments: 'Optional[Dict[str, Any]]' = None, callback: 'Optional[_OnExchangeUnbindCallback]' = None) -> 'None'
| Unbind an exchange from another exchange.
|
| :param str destination: The destination exchange to unbind
| :param str source: The source exchange to unbind from
| :param str routing_key: The routing key to unbind
| :param dict arguments: Custom key/value pair arguments for the binding
| :param callable callback: callback(pika.frame.Method) for method Exchange.UnbindOk
| :returns: ``None``. Method frame from the Exchange.Unbind-ok response is
| delivered to ``callback`` when synchronous (no ok frame in nowait
| mode).
| :raises ValueError:
|
| flow(self, active: 'bool', callback: 'Optional[_OnFlowCallback]' = None) -> 'None'
| Turn Channel flow control off and on. Pass a callback to be notified
| of the response from the server. active is a bool. Callback should
| expect a bool in response indicating channel flow state. For more
| information, please reference:
|
| https://www.rabbitmq.com/amqp-0-9-1-reference.html#channel.flow
|
| :param bool active: Turn flow on or off
| :param callable callback: callback(bool) upon completion
| :raises ValueError:
|
| open(self) -> 'None'
| Open the channel
|
| queue_bind(self, queue: 'str', exchange: 'str', routing_key: 'Optional[str]' = None, arguments: 'Optional[Dict[str, Any]]' = None, callback: 'Optional[_OnQueueBindCallback]' = None) -> 'None'
| Bind the queue to the specified exchange
|
| :param str queue: The queue to bind to the exchange
| :param str exchange: The source exchange to bind to
| :param str routing_key: The routing key to bind on
| :param dict arguments: Custom key/value pair arguments for the binding
| :param callable callback: callback(pika.frame.Method) for method Queue.BindOk
| :returns: ``None``. Method frame from the Queue.Bind-ok response is delivered
| to ``callback`` when synchronous (no ok frame in nowait mode).
| :raises ValueError:
|
| queue_declare(self, queue: 'str', passive: 'bool' = False, durable: 'bool' = False, exclusive: 'bool' = False, auto_delete: 'bool' = False, arguments: 'Optional[Dict[str, Any]]' = None, callback: 'Optional[_OnQueueDeclareCallback]' = None) -> 'None'
| Declare queue, create if needed. This method creates or checks a
| queue. When creating a new queue the client can specify various
| properties that control the durability of the queue and its contents,
| and the level of sharing for the queue.
|
| Use an empty string as the queue name for the broker to auto-generate
| one
|
| :param str queue: The queue name; if empty string, the broker will
| create a unique queue name
| :param bool passive: Only check to see if the queue exists
| :param bool durable: Survive reboots of the broker
| :param bool exclusive: Only allow access by the current connection
| :param bool auto_delete: Delete after consumer cancels or disconnects
| :param dict arguments: Custom key/value arguments for the queue
| :param callable callback: callback(pika.frame.Method) for method Queue.DeclareOk
| :returns: ``None``. Method frame from the Queue.Declare-ok response is
| delivered to ``callback`` when synchronous (no ok frame in nowait
| mode).
| :raises ValueError:
|
| queue_delete(self, queue: 'str', if_unused: 'bool' = False, if_empty: 'bool' = False, callback: 'Optional[_OnQueueDeleteCallback]' = None) -> 'None'
| Delete a queue from the broker.
|
| :param str queue: The queue to delete
| :param bool if_unused: only delete if it's unused
| :param bool if_empty: only delete if the queue is empty
| :param callable callback: callback(pika.frame.Method) for method Queue.DeleteOk
| :returns: ``None``. Method frame from the Queue.Delete-ok response is
| delivered to ``callback`` when synchronous (no ok frame in nowait
| mode).
| :raises ValueError:
|
| queue_purge(self, queue: 'str', callback: 'Optional[_OnQueuePurgeCallback]' = None) -> 'None'
| Purge all of the messages from the specified queue
|
| :param str queue: The queue to purge
| :param callable callback: callback(pika.frame.Method) for method Queue.PurgeOk
| :returns: ``None``. Method frame from the Queue.Purge-ok response is
| delivered to ``callback`` when synchronous (no ok frame in nowait
| mode).
| :raises ValueError:
|
| queue_unbind(self, queue: 'str', exchange: 'Optional[str]' = None, routing_key: 'Optional[str]' = None, arguments: 'Optional[Dict[str, Any]]' = None, callback: 'Optional[_OnQueueUnbindCallback]' = None) -> 'None'
| Unbind a queue from an exchange.
|
| :param str queue: The queue to unbind from the exchange
| :param str exchange: The source exchange to bind from
| :param str routing_key: The routing key to unbind
| :param dict arguments: Custom key/value pair arguments for the binding
| :param callable callback: callback(pika.frame.Method) for method Queue.UnbindOk
| :returns: ``None``. Method frame from the Queue.Unbind-ok response is
| delivered to ``callback`` when provided.
| :raises ValueError:
|
| tx_commit(self, callback: 'Optional[_OnTxCommitCallback]' = None) -> 'None'
| Commit a transaction
|
| :param callable callback: callback(pika.frame.Method) for method Tx.CommitOk
| :returns: ``None``. Method frame from the Tx.Commit-ok response is delivered
| to ``callback`` when provided.
| :raises ValueError:
|
| tx_rollback(self, callback: 'Optional[_OnTxRollbackCallback]' = None) -> 'None'
| Rollback a transaction.
|
| :param callable callback: callback(pika.frame.Method) for method Tx.RollbackOk
| :returns: ``None``. Method frame from the Tx.Rollback-ok response is delivered
| to ``callback`` when provided.
| :raises ValueError:
|
| tx_select(self, callback: 'Optional[_OnTxSelectCallback]' = None) -> 'None'
| Select standard transaction mode. This method sets the channel to use
| standard transactions. The client must use this method at least once on
| a channel before using the Commit or Rollback methods.
|
| :param callable callback: callback(pika.frame.Method) for method Tx.SelectOk
| :returns: ``None``. Method frame from the Tx.Select-ok response is delivered
| to ``callback`` when provided.
| :raises ValueError:
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| consumer_tags
| Property method that returns a list of currently active consumers
|
| :rtype: list
|
| is_closed
| Returns True if the channel is closed.
|
| :rtype: bool
|
| is_closing
| Returns True if client-initiated closing of the channel is in
| progress.
|
| :rtype: bool
|
| is_open
| Returns True if the channel is open.
|
| :rtype: bool
|
| is_opening
| Returns True if the channel is opening.
|
| :rtype: bool
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| CLOSED = 0
|
| CLOSING = 3
|
| OPEN = 2
|
| OPENING = 1
|
| __annotations__ = {'_STATE_NAMES': 'Dict[int, str]'}
class ContentFrameAssembler(builtins.object)
| ContentFrameAssembler() -> 'None'
|
| Handle content related frames, building a message and return the message
| back in three parts upon receipt.
|
| Methods defined here:
|
| __init__(self) -> 'None'
| Create a new instance of the conent frame assembler.
|
| process(self, frame_value: 'frame.Frame') -> 'Optional[Tuple[frame.Method, frame.Header, bytes]]'
| Invoked by the Channel object when passed frames that are not
| setup in the rpc process and that don't have explicit reply types
| defined. This includes Basic.Publish, Basic.GetOk and Basic.Return
|
| :param Method|Header|Body frame_value: The frame to process
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
DATA
Callable = typing.Callable
Deprecated alias to collections.abc.Callable.
Callable[[int], str] signifies a function that takes a single
parameter of type int and returns a str.
The subscription syntax must always be used with exactly two
values: the argument list and the return type.
The argument list must be a list of types, a ParamSpec,
Concatenate or ellipsis. The return type must be a single type.
There is no syntax to indicate optional or keyword arguments;
such function types are rarely used as callback types.
Dict = typing.Dict
A generic version of dict.
LOGGER = <Logger pika.channel (WARNING)>
List = typing.List
A generic version of list.
MAX_CHANNELS = 65535
Optional = typing.Optional
Optional[X] is equivalent to Union[X, None].
TYPE_CHECKING = False
Tuple = typing.Tuple
Deprecated alias to builtins.tuple.
Tuple[X, Y] is the cross-product type of X and Y.
Example: Tuple[T1, T2] is a tuple of two elements corresponding
to type variables T1 and T2. Tuple[int, float, str] is a tuple
of an int, a float and a string.
To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
Type = typing.Type
Deprecated alias to builtins.type.
builtins.type or typing.Type can be used to annotate class objects.
For example, suppose we have the following classes::
class User: ... # Abstract base for User classes
class BasicUser(User): ...
class ProUser(User): ...
class TeamUser(User): ...
And a function that takes a class argument that's a subclass of
User and returns an instance of the corresponding class::
def new_user[U](user_class: Type[U]) -> U:
user = user_class()
# (Here we could write the user object to a database)
return user
joe = new_user(BasicUser)
At this point the type checker knows that joe has type BasicUser.
Union = typing.Union
Union type; Union[X, Y] means either X or Y.
On Python 3.10 and higher, the | operator
can also be used to denote unions;
X | Y means the same thing to the type checker as Union[X, Y].
To define a union, use e.g. Union[int, str]. Details:
- The arguments must be types and there must be at least one.
- None as an argument is a special case and is replaced by
type(None).
- Unions of unions are flattened, e.g.::
assert Union[Union[int, str], float] == Union[int, str, float]
- Unions of a single argument vanish, e.g.::
assert Union[int] == int # The constructor actually returns int
- Redundant arguments are skipped, e.g.::
assert Union[int, str, int] == Union[int, str]
- When comparing unions, the argument order is ignored, e.g.::
assert Union[int, str] == Union[str, int]
- You cannot subclass or instantiate a union.
- You can use Optional[X] as a shorthand for Union[X, None].
__annotations__ = {'MAX_CHANNELS': 'int'}
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pika\channel.py
pika.compat
Python Library Documentation: module pika.compat in pika
NAME
pika.compat - The compat module provides various compatibility functions
CLASSES
builtins.int(builtins.object)
long
class long(builtins.int)
| A marker class that signifies that the integer value should be
| serialized as `l` instead of `I`
|
| Method resolution order:
| long
| builtins.int
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> str
| Return repr(self).
|
| __str__(self) -> str
| Return str(self).
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.int:
|
| __abs__(self, /)
| abs(self)
|
| __add__(self, value, /)
| Return self+value.
|
| __and__(self, value, /)
| Return self&value.
|
| __bool__(self, /)
| True if self else False
|
| __ceil__(...)
| Ceiling of an Integral returns itself.
|
| __divmod__(self, value, /)
| Return divmod(self, value).
|
| __eq__(self, value, /)
| Return self==value.
|
| __float__(self, /)
| float(self)
|
| __floor__(...)
| Flooring an Integral returns itself.
|
| __floordiv__(self, value, /)
| Return self//value.
|
| __format__(self, format_spec, /)
| Convert to a string according to format_spec.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __getnewargs__(self, /)
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __index__(self, /)
| Return self converted to an integer, if self is suitable for use as an index into a list.
|
| __int__(self, /)
| int(self)
|
| __invert__(self, /)
| ~self
|
| __le__(self, value, /)
| Return self<=value.
|
| __lshift__(self, value, /)
| Return self<<value.
|
| __lt__(self, value, /)
| Return self<value.
|
| __mod__(self, value, /)
| Return self%value.
|
| __mul__(self, value, /)
| Return self*value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __neg__(self, /)
| -self
|
| __or__(self, value, /)
| Return self|value.
|
| __pos__(self, /)
| +self
|
| __pow__(self, value, mod=None, /)
| Return pow(self, value, mod).
|
| __radd__(self, value, /)
| Return value+self.
|
| __rand__(self, value, /)
| Return value&self.
|
| __rdivmod__(self, value, /)
| Return divmod(value, self).
|
| __rfloordiv__(self, value, /)
| Return value//self.
|
| __rlshift__(self, value, /)
| Return value<<self.
|
| __rmod__(self, value, /)
| Return value%self.
|
| __rmul__(self, value, /)
| Return value*self.
|
| __ror__(self, value, /)
| Return value|self.
|
| __round__(...)
| Rounding an Integral returns itself.
|
| Rounding with an ndigits argument also returns an integer.
|
| __rpow__(self, value, mod=None, /)
| Return pow(value, self, mod).
|
| __rrshift__(self, value, /)
| Return value>>self.
|
| __rshift__(self, value, /)
| Return self>>value.
|
| __rsub__(self, value, /)
| Return value-self.
|
| __rtruediv__(self, value, /)
| Return value/self.
|
| __rxor__(self, value, /)
| Return value^self.
|
| __sizeof__(self, /)
| Returns size in memory, in bytes.
|
| __sub__(self, value, /)
| Return self-value.
|
| __truediv__(self, value, /)
| Return self/value.
|
| __trunc__(...)
| Truncating an Integral returns itself.
|
| __xor__(self, value, /)
| Return self^value.
|
| as_integer_ratio(self, /)
| Return a pair of integers, whose ratio is equal to the original int.
|
| The ratio is in lowest terms and has a positive denominator.
|
| >>> (10).as_integer_ratio()
| (10, 1)
| >>> (-10).as_integer_ratio()
| (-10, 1)
| >>> (0).as_integer_ratio()
| (0, 1)
|
| bit_count(self, /)
| Number of ones in the binary representation of the absolute value of self.
|
| Also known as the population count.
|
| >>> bin(13)
| '0b1101'
| >>> (13).bit_count()
| 3
|
| bit_length(self, /)
| Number of bits necessary to represent self in binary.
|
| >>> bin(37)
| '0b100101'
| >>> (37).bit_length()
| 6
|
| conjugate(...)
| Returns self, the complex conjugate of any int.
|
| is_integer(self, /)
| Returns True. Exists for duck type compatibility with float.is_integer.
|
| to_bytes(self, /, length=1, byteorder='big', *, signed=False)
| Return an array of bytes representing an integer.
|
| length
| Length of bytes object to use. An OverflowError is raised if the
| integer is not representable with the given number of bytes. Default
| is length 1.
| byteorder
| The byte order used to represent the integer. If byteorder is 'big',
| the most significant byte is at the beginning of the byte array. If
| byteorder is 'little', the most significant byte is at the end of the
| byte array. To request the native byte order of the host system, use
| `sys.byteorder' as the byte order value. Default is to use 'big'.
| signed
| Determines whether two's complement is used to represent the integer.
| If signed is False and a negative integer is given, an OverflowError
| is raised.
|
| ----------------------------------------------------------------------
| Class methods inherited from builtins.int:
|
| from_bytes(bytes, byteorder='big', *, signed=False)
| Return the integer represented by the given array of bytes.
|
| bytes
| Holds the array of bytes to convert. The argument must either
| support the buffer protocol or be an iterable object producing bytes.
| Bytes and bytearray are examples of built-in objects that support the
| buffer protocol.
| byteorder
| The byte order used to represent the integer. If byteorder is 'big',
| the most significant byte is at the beginning of the byte array. If
| byteorder is 'little', the most significant byte is at the end of the
| byte array. To request the native byte order of the host system, use
| `sys.byteorder' as the byte order value. Default is to use 'big'.
| signed
| Indicates whether two's complement is used to represent the integer.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.int:
|
| __new__(*args, **kwargs) class method of builtins.int
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.int:
|
| denominator
| the denominator of a rational number in lowest terms
|
| imag
| the imaginary part of a complex number
|
| numerator
| the numerator of a rational number in lowest terms
|
| real
| the real part of a complex number
FUNCTIONS
as_bytes(value: Union[str, bytes]) -> bytes
Returns value as bytes
byte(*args) -> bytes
Returns a single byte `bytes` for the given int argument (we
optimize it a bit here by passing the positional argument tuple
directly to the bytes constructor.
get_linux_version(release_str: str) -> Tuple[int, ...]
Gets linux version
nonblocking_socketpair(family: int = <AddressFamily.AF_INET: 2>, socket_type: int = <SocketKind.SOCK_STREAM: 1>, proto: int = 0) -> Tuple[socket.socket, socket.socket]
Returns a pair of sockets in the manner of socketpair with the additional
feature that they will be non-blocking. Prior to Python 3.5, socketpair
did not exist on Windows at all.
time_now() -> float
Returns monotonic time
to_digit(value: str) -> int
Returns value as in integer
DATA
HAVE_SIGNAL = False
LINUX_VERSION = None
ON_LINUX = False
ON_OSX = False
ON_WINDOWS = True
RE_NUM = re.compile('(\\d+).+')
SOL_TCP = 6
Tuple = typing.Tuple
Deprecated alias to builtins.tuple.
Tuple[X, Y] is the cross-product type of X and Y.
Example: Tuple[T1, T2] is a tuple of two elements corresponding
to type variables T1 and T2. Tuple[int, float, str] is a tuple
of an int, a float and a string.
To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
Union = typing.Union
Union type; Union[X, Y] means either X or Y.
On Python 3.10 and higher, the | operator
can also be used to denote unions;
X | Y means the same thing to the type checker as Union[X, Y].
To define a union, use e.g. Union[int, str]. Details:
- The arguments must be types and there must be at least one.
- None as an argument is a special case and is replaced by
type(None).
- Unions of unions are flattened, e.g.::
assert Union[Union[int, str], float] == Union[int, str, float]
- Unions of a single argument vanish, e.g.::
assert Union[int] == int # The constructor actually returns int
- Redundant arguments are skipped, e.g.::
assert Union[int, str, int] == Union[int, str]
- When comparing unions, the argument order is ignored, e.g.::
assert Union[int, str] == Union[str, int]
- You cannot subclass or instantiate a union.
- You can use Optional[X] as a shorthand for Union[X, None].
str_or_bytes = (<class 'str'>, <class 'bytes'>)
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pika\compat.py
pika.connection
Python Library Documentation: module pika.connection in pika
NAME
pika.connection - Core connection objects
CLASSES
abc.AbstractBase(builtins.object)
Connection
builtins.object
Parameters
ConnectionParameters
URLParameters
SSLOptions
class Connection(abc.AbstractBase)
| Connection(parameters: 'Optional[Parameters]' = None, on_open_callback: 'Optional[Callable[[Connection], Any]]' = None, on_open_error_callback: 'Optional[Callable[[Connection, Exception], Any]]' = None, on_close_callback: 'Optional[Callable[[Connection, Exception], Any]]' = None, internal_connection_workflow: 'bool' = True) -> 'None'
|
| This is the core class that implements communication with RabbitMQ. This
| class should not be invoked directly but rather through the use of an
| adapter such as SelectConnection or BlockingConnection.
|
| Method resolution order:
| Connection
| abc.AbstractBase
| builtins.object
|
| Methods defined here:
|
| __init__(self, parameters: 'Optional[Parameters]' = None, on_open_callback: 'Optional[Callable[[Connection], Any]]' = None, on_open_error_callback: 'Optional[Callable[[Connection, Exception], Any]]' = None, on_close_callback: 'Optional[Callable[[Connection, Exception], Any]]' = None, internal_connection_workflow: 'bool' = True) -> 'None'
| Connection initialization expects an object that has implemented the
| Parameters class and a callback function to notify when we have
| successfully connected to the AMQP Broker.
|
| Available Parameters classes are the ConnectionParameters class and
| URLParameters class.
|
| :param pika.connection.Parameters parameters: Read-only connection
| parameters.
| :param callable on_open_callback: Called when the connection is opened:
| on_open_callback(connection)
| :param None | method on_open_error_callback: Called if the connection
| can't be established or connection establishment is interrupted by
| `Connection.close()`: on_open_error_callback(Connection, exception).
| :param None | method on_close_callback: Called when a previously fully
| open connection is closed:
| `on_close_callback(Connection, exception)`, where `exception` is
| either an instance of `exceptions.ConnectionClosed` if closed by
| user or broker or exception of another type that describes the cause
| of connection failure.
| :param bool internal_connection_workflow: True for autonomous connection
| establishment which is default; False for externally-managed
| connection workflow via the `create_connection()` factory.
|
| add_on_close_callback(self, callback: 'Callable[[Connection, Exception], Any]') -> 'None'
| Add a callback notification when the connection has closed. The
| callback will be passed the connection and an exception instance. The
| exception will either be an instance of `exceptions.ConnectionClosed` if
| a fully-open connection was closed by user or broker or exception of
| another type that describes the cause of connection closure/failure.
|
| :param callable callback: Callback to call on close, having the signature:
| callback(pika.connection.Connection, exception)
|
| add_on_connection_blocked_callback(self, callback: 'Callable[[Connection, frame.Method[spec.Connection.Blocked]], Any]') -> 'None'
| RabbitMQ AMQP extension - Add a callback to be notified when the
| connection gets blocked (`Connection.Blocked` received from RabbitMQ)
| due to the broker running low on resources (memory or disk). In this
| state RabbitMQ suspends processing incoming data until the connection
| is unblocked, so it's a good idea for publishers receiving this
| notification to suspend publishing until the connection becomes
| unblocked.
|
| See also `Connection.add_on_connection_unblocked_callback()`
|
| See also `ConnectionParameters.blocked_connection_timeout`.
|
| :param callable callback: Callback to call on `Connection.Blocked`,
| having the signature `callback(connection, pika.frame.Method)`,
| where the method frame's `method` member is of type
| `pika.spec.Connection.Blocked`
|
| add_on_connection_unblocked_callback(self, callback: 'Callable[[Connection, frame.Method[spec.Connection.Unblocked]], Any]') -> 'None'
| RabbitMQ AMQP extension - Add a callback to be notified when the
| connection gets unblocked (`Connection.Unblocked` frame is received from
| RabbitMQ) letting publishers know it's ok to start publishing again.
|
| :param callable callback: Callback to call on
| `Connection.Unblocked`, having the signature
| `callback(connection, pika.frame.Method)`, where the method frame's
| `method` member is of type `pika.spec.Connection.Unblocked`
|
| add_on_open_callback(self, callback: 'Callable[[Connection], Any]') -> 'None'
| Add a callback notification when the connection has opened. The
| callback will be passed the connection instance as its only arg.
|
| :param callable callback: Callback to call when open
|
| add_on_open_error_callback(self, callback: 'Callable[[Connection, Optional[BaseException]], Any]', remove_default: 'bool' = True) -> 'None'
| Add a callback notification when the connection can not be opened.
|
| The callback method should accept the connection instance that could not
| connect, and either a string or an exception as its second arg.
|
| :param callable callback: Callback to call when can't connect, having
| the signature _(Connection, Exception)
| :param bool remove_default: Remove default exception raising callback
|
| channel(self, channel_number: 'Optional[int]' = None, on_open_callback: 'Optional[Callable[[Channel], Any]]' = None) -> 'Channel'
| Create a new channel with the next available channel number or pass
| in a channel number to use. Must be non-zero if you would like to
| specify but it is recommended that you let Pika manage the channel
| numbers.
|
| :param int channel_number: The channel number to use, defaults to the
| next available.
| :param callable on_open_callback: The callback when the channel is
| opened. The callback will be invoked with the `Channel` instance
| as its only argument.
| :rtype: pika.channel.Channel
|
| close(self, reply_code: 'int' = 200, reply_text: 'str' = 'Normal shutdown') -> 'None'
| Disconnect from RabbitMQ. If there are any open channels, it will
| attempt to close them prior to fully disconnecting. Channels which
| have active consumers will attempt to send a Basic.Cancel to RabbitMQ
| to cleanly stop the delivery of messages prior to closing the channel.
|
| :param int reply_code: The code number for the close
| :param str reply_text: The text reason for the close
|
| :raises pika.exceptions.ConnectionWrongStateError: if connection is
| closed or closing.
|
| update_secret(self, new_secret: 'str', reason: 'str', callback: 'Optional[Callable[[frame.Method[spec.Connection.UpdateSecretOk]], Any]]' = None) -> 'None'
| RabbitMQ AMQP extension - This method updates the secret used to authenticate this connection.
| It is used when secrets have an expiration date and need to be renewed, like OAuth 2 tokens.
| Pass a callback to be notified of the response from the server.
|
| :param string new_secret: The new secret
| :param string reason: The reason for the secret update
| :param callable callback: Callback to call on
| `Connection.UpdateSecretOk`, having the signature
| `callback(pika.frame.Method)`, where the method frame's
| `method` member is of type `pika.spec.Connection.UpdateSecretOk`
|
| :raises pika.exceptions.ConnectionWrongStateError: if connection is
| not open.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| basic_nack
| Specifies if the server supports basic.nack on the active connection.
|
| :rtype: bool
|
| consumer_cancel_notify
| Specifies if the server supports consumer cancel notification on the
| active connection.
|
| :rtype: bool
|
| exchange_exchange_bindings
| Specifies if the active connection supports exchange to exchange
| bindings.
|
| :rtype: bool
|
| is_closed
| Returns a boolean reporting the current connection state.
|
| is_closing
| Returns True if connection is in the process of closing due to
| client-initiated `close` request, but closing is not yet complete.
|
| is_open
| Returns a boolean reporting the current connection state.
|
| publisher_confirms
| Specifies if the active connection can use publisher confirmations.
|
| :rtype: bool
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| CONNECTION_CLOSED = 0
|
| CONNECTION_CLOSING = 6
|
| CONNECTION_INIT = 1
|
| CONNECTION_OPEN = 5
|
| CONNECTION_PROTOCOL = 2
|
| CONNECTION_START = 3
|
| CONNECTION_TUNE = 4
|
| ON_CONNECTION_CLOSED = '_on_connection_closed'
|
| ON_CONNECTION_ERROR = '_on_connection_error'
|
| ON_CONNECTION_OPEN_OK = '_on_connection_open_ok'
|
| __abstractmethods__ = frozenset({'_adapter_add_callback_threadsafe', '...
|
| ----------------------------------------------------------------------
| Data descriptors inherited from abc.AbstractBase:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class ConnectionParameters(Parameters)
| ConnectionParameters(host: 'DefaultT[str]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, port: 'DefaultT[int]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, virtual_host: 'DefaultT[str]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, credentials: 'DefaultT[Union[pika.credentials.PlainCredentials, pika.credentials.ExternalCredentials]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, channel_max: 'DefaultT[int]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, frame_max: 'DefaultT[int]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, heartbeat: 'DefaultT[Optional[Union[int, Callable[[Connection, float], int]]]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, ssl_options: 'DefaultT[Optional[SSLOptions]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, connection_attempts: 'DefaultT[int]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, retry_delay: 'DefaultT[float]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, socket_timeout: 'DefaultT[Optional[float]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, stack_timeout: 'DefaultT[Optional[float]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, locale: 'DefaultT[str]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, blocked_connection_timeout: 'DefaultT[Optional[float]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, client_properties: 'DefaultT[Optional[Dict[str, Any]]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, tcp_options: 'DefaultT[Optional[Dict[str, Any]]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, **kwargs: 'Any') -> 'None'
|
| Connection parameters object that is passed into the connection adapter
| upon construction.
|
| Method resolution order:
| ConnectionParameters
| Parameters
| builtins.object
|
| Methods defined here:
|
| __init__(self, host: 'DefaultT[str]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, port: 'DefaultT[int]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, virtual_host: 'DefaultT[str]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, credentials: 'DefaultT[Union[pika.credentials.PlainCredentials, pika.credentials.ExternalCredentials]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, channel_max: 'DefaultT[int]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, frame_max: 'DefaultT[int]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, heartbeat: 'DefaultT[Optional[Union[int, Callable[[Connection, float], int]]]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, ssl_options: 'DefaultT[Optional[SSLOptions]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, connection_attempts: 'DefaultT[int]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, retry_delay: 'DefaultT[float]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, socket_timeout: 'DefaultT[Optional[float]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, stack_timeout: 'DefaultT[Optional[float]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, locale: 'DefaultT[str]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, blocked_connection_timeout: 'DefaultT[Optional[float]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, client_properties: 'DefaultT[Optional[Dict[str, Any]]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, tcp_options: 'DefaultT[Optional[Dict[str, Any]]]' = <class 'pika.connection.ConnectionParameters._DEFAULT'>, **kwargs: 'Any') -> 'None'
| Create a new ConnectionParameters instance. See `Parameters` for
| default values.
|
| :param str host: Hostname or IP Address to connect to
| :param int port: TCP port to connect to
| :param str virtual_host: RabbitMQ virtual host to use
| :param pika.credentials.PlainCredentials credentials: auth credentials
| :param int channel_max: Maximum number of channels to allow
| :param int frame_max: The maximum byte size for an AMQP frame
| :param int|None|callable heartbeat: Controls AMQP heartbeat timeout negotiation
| during connection tuning. An integer value always overrides the value
| proposed by broker. Use 0 to deactivate heartbeats and None to always
| accept the broker's proposal. If a callable is given, it will be called
| with the connection instance and the heartbeat timeout proposed by broker
| as its arguments. The callback should return a non-negative integer that
| will be used to override the broker's proposal.
| :param `pika.SSLOptions`|None ssl_options: None for plaintext or
| `pika.SSLOptions` instance for SSL/TLS. Defaults to None.
| :param int connection_attempts: Maximum number of retry attempts
| :param int|float retry_delay: Time to wait in seconds, before the next
| :param int|float socket_timeout: Positive socket connect timeout in
| seconds.
| :param int|float stack_timeout: Positive full protocol stack
| (TCP/[SSL]/AMQP) bring-up timeout in seconds. It's recommended to
| set this value higher than `socket_timeout`.
| :param str locale: Set the locale value
| :param int|float|None blocked_connection_timeout: If not None,
| the value is a non-negative timeout, in seconds, for the
| connection to remain blocked (triggered by Connection.Blocked from
| broker); if the timeout expires before connection becomes unblocked,
| the connection will be torn down, triggering the adapter-specific
| mechanism for informing client app about the closed connection:
| passing `ConnectionBlockedTimeout` exception to on_close_callback
| in asynchronous adapters or raising it in `BlockingConnection`.
| :param client_properties: None or dict of client properties used to
| override the fields in the default client properties reported to
| RabbitMQ via `Connection.StartOk` method.
| :param tcp_options: None or a dict of TCP options to set for socket
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| DefaultT = typing.Union[~T, typing.Type[pika.connection.ConnectionPara...
|
| T = ~T
|
| ----------------------------------------------------------------------
| Methods inherited from Parameters:
|
| __eq__(self, other) -> 'bool'
| Return self==value.
|
| __ne__(self, other) -> 'bool'
| Return self!=value.
|
| __repr__(self) -> 'str'
| Represent the info about the instance.
|
| :rtype: str
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Parameters:
|
| blocked_connection_timeout
| :returns: blocked connection timeout. Defaults to
| `DEFAULT_BLOCKED_CONNECTION_TIMEOUT`.
| :rtype: float|None
|
| channel_max
| :returns: max preferred number of channels. Defaults to
| `DEFAULT_CHANNEL_MAX`.
| :rtype: int
|
| client_properties
| :returns: client properties used to override the fields in the default
| client properties reported to RabbitMQ via `Connection.StartOk`
| method. Defaults to `DEFAULT_CLIENT_PROPERTIES`.
| :rtype: dict|None
|
| connection_attempts
| :returns: number of socket connection attempts. Defaults to
| `DEFAULT_CONNECTION_ATTEMPTS`. See also `retry_delay`.
| :rtype: int
|
| credentials
| :rtype: one of the classes from `pika.credentials.VALID_TYPES`. Defaults
| to `DEFAULT_CREDENTIALS`.
|
| frame_max
| :returns: desired maximum AMQP frame size to use. Defaults to
| `DEFAULT_FRAME_MAX`.
| :rtype: int
|
| heartbeat
| :returns: AMQP connection heartbeat timeout value for negotiation during
| connection tuning or callable which is invoked during connection tuning.
| None to accept broker's value. 0 turns heartbeat off. Defaults to
| `DEFAULT_HEARTBEAT_TIMEOUT`.
| :rtype: int|callable|None
|
| host
| :returns: hostname or ip address of broker. Defaults to `DEFAULT_HOST`.
| :rtype: str
|
| locale
| :returns: locale value to pass to broker; e.g., 'en_US'. Defaults to
| `DEFAULT_LOCALE`.
| :rtype: str
|
| port
| :returns: port number of broker's listening socket. Defaults to
| `DEFAULT_PORT`.
| :rtype: int
|
| retry_delay
| :returns: interval between socket connection attempts; see also
| `connection_attempts`. Defaults to `DEFAULT_RETRY_DELAY`.
| :rtype: float
|
| socket_timeout
| :returns: socket connect timeout in seconds. Defaults to
| `DEFAULT_SOCKET_TIMEOUT`. The value None disables this timeout.
| :rtype: float|None
|
| ssl_options
| :returns: None for plaintext or `pika.SSLOptions` instance for SSL/TLS.
| :rtype: `pika.SSLOptions`|None
|
| stack_timeout
| :returns: full protocol stack TCP/[SSL]/AMQP bring-up timeout in
| seconds. Defaults to `DEFAULT_STACK_TIMEOUT`. The value None
| disables this timeout.
| :rtype: float
|
| tcp_options
| :returns: None or a dict of options to pass to the underlying socket
| :rtype: dict|None
|
| virtual_host
| :returns: rabbitmq virtual host name. Defaults to
| `DEFAULT_VIRTUAL_HOST`.
| :rtype: str
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Parameters:
|
| DEFAULT_BLOCKED_CONNECTION_TIMEOUT = None
|
| DEFAULT_CHANNEL_MAX = 65535
|
| DEFAULT_CLIENT_PROPERTIES = None
|
| DEFAULT_CONNECTION_ATTEMPTS = 1
|
| DEFAULT_CREDENTIALS = <pika.credentials.PlainCredentials object>
|
| DEFAULT_FRAME_MAX = 131072
|
| DEFAULT_HEARTBEAT_TIMEOUT = None
|
| DEFAULT_HOST = 'localhost'
|
| DEFAULT_LOCALE = 'en_US'
|
| DEFAULT_PASSWORD = 'guest'
|
| DEFAULT_PORT = 5672
|
| DEFAULT_RETRY_DELAY = 2.0
|
| DEFAULT_SOCKET_TIMEOUT = 10.0
|
| DEFAULT_SSL = False
|
| DEFAULT_SSL_OPTIONS = None
|
| DEFAULT_SSL_PORT = 5671
|
| DEFAULT_STACK_TIMEOUT = 15.0
|
| DEFAULT_TCP_OPTIONS = None
|
| DEFAULT_USERNAME = 'guest'
|
| DEFAULT_VIRTUAL_HOST = '/'
|
| __hash__ = None
class Parameters(builtins.object)
| Parameters() -> 'None'
|
| Base connection parameters class definition
|
| Methods defined here:
|
| __eq__(self, other) -> 'bool'
| Return self==value.
|
| __init__(self) -> 'None'
| Initialize self. See help(type(self)) for accurate signature.
|
| __ne__(self, other) -> 'bool'
| Return self!=value.
|
| __repr__(self) -> 'str'
| Represent the info about the instance.
|
| :rtype: str
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| blocked_connection_timeout
| :returns: blocked connection timeout. Defaults to
| `DEFAULT_BLOCKED_CONNECTION_TIMEOUT`.
| :rtype: float|None
|
| channel_max
| :returns: max preferred number of channels. Defaults to
| `DEFAULT_CHANNEL_MAX`.
| :rtype: int
|
| client_properties
| :returns: client properties used to override the fields in the default
| client properties reported to RabbitMQ via `Connection.StartOk`
| method. Defaults to `DEFAULT_CLIENT_PROPERTIES`.
| :rtype: dict|None
|
| connection_attempts
| :returns: number of socket connection attempts. Defaults to
| `DEFAULT_CONNECTION_ATTEMPTS`. See also `retry_delay`.
| :rtype: int
|
| credentials
| :rtype: one of the classes from `pika.credentials.VALID_TYPES`. Defaults
| to `DEFAULT_CREDENTIALS`.
|
| frame_max
| :returns: desired maximum AMQP frame size to use. Defaults to
| `DEFAULT_FRAME_MAX`.
| :rtype: int
|
| heartbeat
| :returns: AMQP connection heartbeat timeout value for negotiation during
| connection tuning or callable which is invoked during connection tuning.
| None to accept broker's value. 0 turns heartbeat off. Defaults to
| `DEFAULT_HEARTBEAT_TIMEOUT`.
| :rtype: int|callable|None
|
| host
| :returns: hostname or ip address of broker. Defaults to `DEFAULT_HOST`.
| :rtype: str
|
| locale
| :returns: locale value to pass to broker; e.g., 'en_US'. Defaults to
| `DEFAULT_LOCALE`.
| :rtype: str
|
| port
| :returns: port number of broker's listening socket. Defaults to
| `DEFAULT_PORT`.
| :rtype: int
|
| retry_delay
| :returns: interval between socket connection attempts; see also
| `connection_attempts`. Defaults to `DEFAULT_RETRY_DELAY`.
| :rtype: float
|
| socket_timeout
| :returns: socket connect timeout in seconds. Defaults to
| `DEFAULT_SOCKET_TIMEOUT`. The value None disables this timeout.
| :rtype: float|None
|
| ssl_options
| :returns: None for plaintext or `pika.SSLOptions` instance for SSL/TLS.
| :rtype: `pika.SSLOptions`|None
|
| stack_timeout
| :returns: full protocol stack TCP/[SSL]/AMQP bring-up timeout in
| seconds. Defaults to `DEFAULT_STACK_TIMEOUT`. The value None
| disables this timeout.
| :rtype: float
|
| tcp_options
| :returns: None or a dict of options to pass to the underlying socket
| :rtype: dict|None
|
| virtual_host
| :returns: rabbitmq virtual host name. Defaults to
| `DEFAULT_VIRTUAL_HOST`.
| :rtype: str
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| DEFAULT_BLOCKED_CONNECTION_TIMEOUT = None
|
| DEFAULT_CHANNEL_MAX = 65535
|
| DEFAULT_CLIENT_PROPERTIES = None
|
| DEFAULT_CONNECTION_ATTEMPTS = 1
|
| DEFAULT_CREDENTIALS = <pika.credentials.PlainCredentials object>
|
| DEFAULT_FRAME_MAX = 131072
|
| DEFAULT_HEARTBEAT_TIMEOUT = None
|
| DEFAULT_HOST = 'localhost'
|
| DEFAULT_LOCALE = 'en_US'
|
| DEFAULT_PASSWORD = 'guest'
|
| DEFAULT_PORT = 5672
|
| DEFAULT_RETRY_DELAY = 2.0
|
| DEFAULT_SOCKET_TIMEOUT = 10.0
|
| DEFAULT_SSL = False
|
| DEFAULT_SSL_OPTIONS = None
|
| DEFAULT_SSL_PORT = 5671
|
| DEFAULT_STACK_TIMEOUT = 15.0
|
| DEFAULT_TCP_OPTIONS = None
|
| DEFAULT_USERNAME = 'guest'
|
| DEFAULT_VIRTUAL_HOST = '/'
|
| __hash__ = None
class SSLOptions(builtins.object)
| SSLOptions(context: 'ssl.SSLContext', server_hostname: 'Optional[str]' = None) -> 'None'
|
| Class used to provide parameters for optional fine grained control of SSL
| socket wrapping.
|
| Methods defined here:
|
| __init__(self, context: 'ssl.SSLContext', server_hostname: 'Optional[str]' = None) -> 'None'
| :param ssl.SSLContext context: SSLContext instance
| :param str|None server_hostname: SSLContext.wrap_socket, used to enable
| SNI
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| context
|
| server_hostname
class URLParameters(Parameters)
| URLParameters(url: 'str') -> 'None'
|
| Connect to RabbitMQ via an AMQP URL in the format::
|
| amqp://username:password@host:port/<virtual_host>[?query-string]
|
| Ensure that the virtual host is URI encoded when specified. For example if
| you are using the default "/" virtual host, the value should be `%2f`.
|
| See `Parameters` for default values.
|
| Valid query string values are:
|
| - channel_max:
| Override the default maximum channel count value
| - client_properties:
| dict of client properties used to override the fields in the default
| client properties reported to RabbitMQ via `Connection.StartOk`
| method
| - connection_attempts:
| Specify how many times pika should try and reconnect before it gives up
| - frame_max:
| Override the default maximum frame size for communication
| - heartbeat:
| Desired connection heartbeat timeout for negotiation. If not present
| the broker's value is accepted. 0 turns heartbeat off.
| - locale:
| Override the default `en_US` locale value
| - ssl_options:
| None for plaintext; for SSL: dict of public ssl context-related
| arguments that may be passed to :meth:`ssl.SSLSocket` as kwargs,
| except `sock`, `server_side`,`do_handshake_on_connect`, `family`,
| `type`, `proto`, `fileno`.
| - retry_delay:
| The number of seconds to sleep before attempting to connect on
| connection failure.
| - socket_timeout:
| Socket connect timeout value in seconds (float or int)
| - stack_timeout:
| Positive full protocol stack (TCP/[SSL]/AMQP) bring-up timeout in
| seconds. It's recommended to set this value higher than
| `socket_timeout`.
| - blocked_connection_timeout:
| Set the timeout, in seconds, that the connection may remain blocked
| (triggered by Connection.Blocked from broker); if the timeout
| expires before connection becomes unblocked, the connection will be
| torn down, triggering the connection's on_close_callback
| - tcp_options:
| Set the tcp options for the underlying socket.
|
| :param str url: The AMQP URL to connect to
|
| Method resolution order:
| URLParameters
| Parameters
| builtins.object
|
| Methods defined here:
|
| __init__(self, url: 'str') -> 'None'
| Create a new URLParameters instance.
|
| :param str url: The URL value
|
| ----------------------------------------------------------------------
| Methods inherited from Parameters:
|
| __eq__(self, other) -> 'bool'
| Return self==value.
|
| __ne__(self, other) -> 'bool'
| Return self!=value.
|
| __repr__(self) -> 'str'
| Represent the info about the instance.
|
| :rtype: str
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Parameters:
|
| blocked_connection_timeout
| :returns: blocked connection timeout. Defaults to
| `DEFAULT_BLOCKED_CONNECTION_TIMEOUT`.
| :rtype: float|None
|
| channel_max
| :returns: max preferred number of channels. Defaults to
| `DEFAULT_CHANNEL_MAX`.
| :rtype: int
|
| client_properties
| :returns: client properties used to override the fields in the default
| client properties reported to RabbitMQ via `Connection.StartOk`
| method. Defaults to `DEFAULT_CLIENT_PROPERTIES`.
| :rtype: dict|None
|
| connection_attempts
| :returns: number of socket connection attempts. Defaults to
| `DEFAULT_CONNECTION_ATTEMPTS`. See also `retry_delay`.
| :rtype: int
|
| credentials
| :rtype: one of the classes from `pika.credentials.VALID_TYPES`. Defaults
| to `DEFAULT_CREDENTIALS`.
|
| frame_max
| :returns: desired maximum AMQP frame size to use. Defaults to
| `DEFAULT_FRAME_MAX`.
| :rtype: int
|
| heartbeat
| :returns: AMQP connection heartbeat timeout value for negotiation during
| connection tuning or callable which is invoked during connection tuning.
| None to accept broker's value. 0 turns heartbeat off. Defaults to
| `DEFAULT_HEARTBEAT_TIMEOUT`.
| :rtype: int|callable|None
|
| host
| :returns: hostname or ip address of broker. Defaults to `DEFAULT_HOST`.
| :rtype: str
|
| locale
| :returns: locale value to pass to broker; e.g., 'en_US'. Defaults to
| `DEFAULT_LOCALE`.
| :rtype: str
|
| port
| :returns: port number of broker's listening socket. Defaults to
| `DEFAULT_PORT`.
| :rtype: int
|
| retry_delay
| :returns: interval between socket connection attempts; see also
| `connection_attempts`. Defaults to `DEFAULT_RETRY_DELAY`.
| :rtype: float
|
| socket_timeout
| :returns: socket connect timeout in seconds. Defaults to
| `DEFAULT_SOCKET_TIMEOUT`. The value None disables this timeout.
| :rtype: float|None
|
| ssl_options
| :returns: None for plaintext or `pika.SSLOptions` instance for SSL/TLS.
| :rtype: `pika.SSLOptions`|None
|
| stack_timeout
| :returns: full protocol stack TCP/[SSL]/AMQP bring-up timeout in
| seconds. Defaults to `DEFAULT_STACK_TIMEOUT`. The value None
| disables this timeout.
| :rtype: float
|
| tcp_options
| :returns: None or a dict of options to pass to the underlying socket
| :rtype: dict|None
|
| virtual_host
| :returns: rabbitmq virtual host name. Defaults to
| `DEFAULT_VIRTUAL_HOST`.
| :rtype: str
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from Parameters:
|
| DEFAULT_BLOCKED_CONNECTION_TIMEOUT = None
|
| DEFAULT_CHANNEL_MAX = 65535
|
| DEFAULT_CLIENT_PROPERTIES = None
|
| DEFAULT_CONNECTION_ATTEMPTS = 1
|
| DEFAULT_CREDENTIALS = <pika.credentials.PlainCredentials object>
|
| DEFAULT_FRAME_MAX = 131072
|
| DEFAULT_HEARTBEAT_TIMEOUT = None
|
| DEFAULT_HOST = 'localhost'
|
| DEFAULT_LOCALE = 'en_US'
|
| DEFAULT_PASSWORD = 'guest'
|
| DEFAULT_PORT = 5672
|
| DEFAULT_RETRY_DELAY = 2.0
|
| DEFAULT_SOCKET_TIMEOUT = 10.0
|
| DEFAULT_SSL = False
|
| DEFAULT_SSL_OPTIONS = None
|
| DEFAULT_SSL_PORT = 5671
|
| DEFAULT_STACK_TIMEOUT = 15.0
|
| DEFAULT_TCP_OPTIONS = None
|
| DEFAULT_USERNAME = 'guest'
|
| DEFAULT_VIRTUAL_HOST = '/'
|
| __hash__ = None
DATA
Callable = typing.Callable
Deprecated alias to collections.abc.Callable.
Callable[[int], str] signifies a function that takes a single
parameter of type int and returns a str.
The subscription syntax must always be used with exactly two
values: the argument list and the return type.
The argument list must be a list of types, a ParamSpec,
Concatenate or ellipsis. The return type must be a single type.
There is no syntax to indicate optional or keyword arguments;
such function types are rarely used as callback types.
Dict = typing.Dict
A generic version of dict.
LOGGER = <Logger pika.connection (WARNING)>
Optional = typing.Optional
Optional[X] is equivalent to Union[X, None].
PRODUCT = 'Pika Python Client Library'
Sequence = typing.Sequence
A generic version of collections.abc.Sequence.
TYPE_CHECKING = False
Tuple = typing.Tuple
Deprecated alias to builtins.tuple.
Tuple[X, Y] is the cross-product type of X and Y.
Example: Tuple[T1, T2] is a tuple of two elements corresponding
to type variables T1 and T2. Tuple[int, float, str] is a tuple
of an int, a float and a string.
To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
Type = typing.Type
Deprecated alias to builtins.type.
builtins.type or typing.Type can be used to annotate class objects.
For example, suppose we have the following classes::
class User: ... # Abstract base for User classes
class BasicUser(User): ...
class ProUser(User): ...
class TeamUser(User): ...
And a function that takes a class argument that's a subclass of
User and returns an instance of the corresponding class::
def new_user[U](user_class: Type[U]) -> U:
user = user_class()
# (Here we could write the user object to a database)
return user
joe = new_user(BasicUser)
At this point the type checker knows that joe has type BasicUser.
Union = typing.Union
Union type; Union[X, Y] means either X or Y.
On Python 3.10 and higher, the | operator
can also be used to denote unions;
X | Y means the same thing to the type checker as Union[X, Y].
To define a union, use e.g. Union[int, str]. Details:
- The arguments must be types and there must be at least one.
- None as an argument is a special case and is replaced by
type(None).
- Unions of unions are flattened, e.g.::
assert Union[Union[int, str], float] == Union[int, str, float]
- Unions of a single argument vanish, e.g.::
assert Union[int] == int # The constructor actually returns int
- Redundant arguments are skipped, e.g.::
assert Union[int, str, int] == Union[int, str]
- When comparing unions, the argument order is ignored, e.g.::
assert Union[int, str] == Union[str, int]
- You cannot subclass or instantiate a union.
- You can use Optional[X] as a shorthand for Union[X, None].
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pika\connection.py
pika.credentials
Python Library Documentation: module pika.credentials in pika
NAME
pika.credentials
DESCRIPTION
The credentials classes are used to encapsulate all authentication
information for the :class:`~pika.connection.ConnectionParameters` class.
The :class:`~pika.credentials.PlainCredentials` class returns the properly
formatted username and password to the :class:`~pika.connection.Connection`.
To authenticate with Pika, create a :class:`~pika.credentials.PlainCredentials`
object passing in the username and password and pass it as the credentials
argument value to the :class:`~pika.connection.ConnectionParameters` object.
If you are using :class:`~pika.connection.URLParameters` you do not need a
credentials object, one will automatically be created for you.
If you are looking to implement SSL certificate style authentication, you would
extend the :class:`~pika.credentials.ExternalCredentials` class implementing
the required behavior.
CLASSES
builtins.object
ExternalCredentials
PlainCredentials
class ExternalCredentials(builtins.object)
| ExternalCredentials() -> 'None'
|
| The ExternalCredentials class allows the connection to use EXTERNAL
| authentication, generally with a client SSL certificate.
|
| Methods defined here:
|
| __eq__(self, other) -> 'bool'
| Return self==value.
|
| __init__(self) -> 'None'
| Create a new instance of ExternalCredentials
|
| __ne__(self, other) -> 'bool'
| Return self!=value.
|
| erase_credentials(self) -> 'None'
| Called by Connection when it no longer needs the credentials
|
| response_for(self, start: 'Connection.Start') -> 'Tuple[Optional[str], Optional[bytes]]'
| Validate that this type of authentication is supported
|
| :param spec.Connection.Start start: Connection.Start method
| :rtype: tuple(str|None, bytes|None)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| TYPE = 'EXTERNAL'
|
| __hash__ = None
class PlainCredentials(builtins.object)
| PlainCredentials(username: 'str', password: 'str', erase_on_connect: 'bool' = False)
|
| A credentials object for the default authentication methodology with
| RabbitMQ.
|
| If you do not pass in credentials to the ConnectionParameters object, it
| will create credentials for 'guest' with the password of 'guest'.
|
| If you pass True to erase_on_connect the credentials will not be stored
| in memory after the Connection attempt has been made.
|
| :param str username: The username to authenticate with
| :param str password: The password to authenticate with
| :param bool erase_on_connect: erase credentials on connect.
|
| Methods defined here:
|
| __eq__(self, other) -> 'bool'
| Return self==value.
|
| __init__(self, username: 'str', password: 'str', erase_on_connect: 'bool' = False)
| Create a new instance of PlainCredentials
|
| :param str username: The username to authenticate with
| :param str password: The password to authenticate with
| :param bool erase_on_connect: erase credentials on connect.
|
| __ne__(self, other) -> 'bool'
| Return self!=value.
|
| erase_credentials(self) -> 'None'
| Called by Connection when it no longer needs the credentials
|
| response_for(self, start: 'Connection.Start') -> 'Tuple[Optional[str], Optional[bytes]]'
| Validate that this type of authentication is supported
|
| :param spec.Connection.Start start: Connection.Start method
| :rtype: tuple(str|None, bytes|None)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| TYPE = 'PLAIN'
|
| __hash__ = None
DATA
LOGGER = <Logger pika.credentials (WARNING)>
List = typing.List
A generic version of list.
Optional = typing.Optional
Optional[X] is equivalent to Union[X, None].
TYPE_CHECKING = False
Tuple = typing.Tuple
Deprecated alias to builtins.tuple.
Tuple[X, Y] is the cross-product type of X and Y.
Example: Tuple[T1, T2] is a tuple of two elements corresponding
to type variables T1 and T2. Tuple[int, float, str] is a tuple
of an int, a float and a string.
To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
Type = typing.Type
Deprecated alias to builtins.type.
builtins.type or typing.Type can be used to annotate class objects.
For example, suppose we have the following classes::
class User: ... # Abstract base for User classes
class BasicUser(User): ...
class ProUser(User): ...
class TeamUser(User): ...
And a function that takes a class argument that's a subclass of
User and returns an instance of the corresponding class::
def new_user[U](user_class: Type[U]) -> U:
user = user_class()
# (Here we could write the user object to a database)
return user
joe = new_user(BasicUser)
At this point the type checker knows that joe has type BasicUser.
Union = typing.Union
Union type; Union[X, Y] means either X or Y.
On Python 3.10 and higher, the | operator
can also be used to denote unions;
X | Y means the same thing to the type checker as Union[X, Y].
To define a union, use e.g. Union[int, str]. Details:
- The arguments must be types and there must be at least one.
- None as an argument is a special case and is replaced by
type(None).
- Unions of unions are flattened, e.g.::
assert Union[Union[int, str], float] == Union[int, str, float]
- Unions of a single argument vanish, e.g.::
assert Union[int] == int # The constructor actually returns int
- Redundant arguments are skipped, e.g.::
assert Union[int, str, int] == Union[int, str]
- When comparing unions, the argument order is ignored, e.g.::
assert Union[int, str] == Union[str, int]
- You cannot subclass or instantiate a union.
- You can use Optional[X] as a shorthand for Union[X, None].
VALID_TYPES = [<class 'pika.credentials.PlainCredentials'>, <class 'pi...
__annotations__ = {'VALID_TYPES': 'List[_CredentialType]'}
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pika\credentials.py
pika.data
Python Library Documentation: module pika.data in pika
NAME
pika.data - AMQP Table Encoding/Decoding
FUNCTIONS
decode_short_string(encoded: bytes, offset: int) -> Tuple[Union[str, bytes], int]
Decode a short string value from ``encoded`` data at ``offset``.
decode_table(encoded: bytes, offset: int) -> Tuple[Dict[Union[str, bytes], Any], int]
Decode the AMQP table passed in from the encoded value returning the
decoded result and the number of bytes read plus the offset.
:param str encoded: The binary encoded data to decode
:param int offset: The starting byte offset
:rtype: tuple
decode_value(encoded: bytes, offset: int) -> Tuple[Any, int]
Decode the value passed in returning the decoded value and the number
of bytes read in addition to the starting offset.
:param str encoded: The binary encoded data to decode
:param int offset: The starting byte offset
:rtype: tuple
:raises: pika.exceptions.InvalidFieldTypeException
encode_short_string(pieces: List[bytes], value: str) -> int
Encode a string value as short string and append it to pieces list
returning the size of the encoded value.
:param list pieces: Already encoded values
:param str value: String value to encode
:rtype: int
encode_table(pieces: List[bytes], table: Optional[Dict[str, Any]]) -> int
Encode a dict as an AMQP table appending the encded table to the
pieces list passed in.
:param list pieces: Already encoded frame pieces
:param dict table: The dict to encode
:rtype: int
encode_value(pieces: List[bytes], value: Any) -> int
Encode the value passed in and append it to the pieces list returning
the the size of the encoded value.
:param list pieces: Already encoded values
:param any value: The value to encode
:rtype: int
DATA
Dict = typing.Dict
A generic version of dict.
List = typing.List
A generic version of list.
Optional = typing.Optional
Optional[X] is equivalent to Union[X, None].
Tuple = typing.Tuple
Deprecated alias to builtins.tuple.
Tuple[X, Y] is the cross-product type of X and Y.
Example: Tuple[T1, T2] is a tuple of two elements corresponding
to type variables T1 and T2. Tuple[int, float, str] is a tuple
of an int, a float and a string.
To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
Union = typing.Union
Union type; Union[X, Y] means either X or Y.
On Python 3.10 and higher, the | operator
can also be used to denote unions;
X | Y means the same thing to the type checker as Union[X, Y].
To define a union, use e.g. Union[int, str]. Details:
- The arguments must be types and there must be at least one.
- None as an argument is a special case and is replaced by
type(None).
- Unions of unions are flattened, e.g.::
assert Union[Union[int, str], float] == Union[int, str, float]
- Unions of a single argument vanish, e.g.::
assert Union[int] == int # The constructor actually returns int
- Redundant arguments are skipped, e.g.::
assert Union[int, str, int] == Union[int, str]
- When comparing unions, the argument order is ignored, e.g.::
assert Union[int, str] == Union[str, int]
- You cannot subclass or instantiate a union.
- You can use Optional[X] as a shorthand for Union[X, None].
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pika\data.py
pika.delivery_mode
Python Library Documentation: module pika.delivery_mode in pika
NAME
pika.delivery_mode
CLASSES
enum.Enum(builtins.object)
DeliveryMode
class DeliveryMode(enum.Enum)
| DeliveryMode(*values)
|
| Method resolution order:
| DeliveryMode
| enum.Enum
| builtins.object
|
| Data and other attributes defined here:
|
| Persistent = <DeliveryMode.Persistent: 2>
|
| Transient = <DeliveryMode.Transient: 1>
|
| ----------------------------------------------------------------------
| Data descriptors inherited from enum.Enum:
|
| name
| The name of the Enum member.
|
| value
| The value of the Enum member.
|
| ----------------------------------------------------------------------
| Static methods inherited from enum.EnumType:
|
| __contains__(value)
| Return True if `value` is in `cls`.
|
| `value` is in `cls` if:
| 1) `value` is a member of `cls`, or
| 2) `value` is the value of one of the `cls`'s members.
|
| __getitem__(name)
| Return the member matching `name`.
|
| __iter__()
| Return members in definition order.
|
| __len__()
| Return the number of members (no aliases)
|
| ----------------------------------------------------------------------
| Readonly properties inherited from enum.EnumType:
|
| __members__
| Returns a mapping of member name->value.
|
| This mapping lists all enum members, including aliases. Note that this
| is a read-only view of the internal mapping.
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pika\delivery_mode.py
pika.diagnostic_utils
Python Library Documentation: module pika.diagnostic_utils in pika
NAME
pika.diagnostic_utils - Diagnostic utilities
FUNCTIONS
create_log_exception_decorator(logger: 'logging.Logger') -> 'Callable[[F], F]'
Create a decorator that logs and reraises any exceptions that escape
the decorated function
:param logging.Logger logger:
:returns: the decorator
:rtype: callable
Usage example
import logging
from pika.diagnostics_utils import create_log_exception_decorator
_log_exception = create_log_exception_decorator(logging.getLogger(__name__))
@_log_exception
def my_func_or_method():
raise Exception('Oops!')
DATA
Callable = typing.Callable
Deprecated alias to collections.abc.Callable.
Callable[[int], str] signifies a function that takes a single
parameter of type int and returns a str.
The subscription syntax must always be used with exactly two
values: the argument list and the return type.
The argument list must be a list of types, a ParamSpec,
Concatenate or ellipsis. The return type must be a single type.
There is no syntax to indicate optional or keyword arguments;
such function types are rarely used as callback types.
F = ~F
TYPE_CHECKING = False
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pika\diagnostic_utils.py
pika.exceptions
Python Library Documentation: module pika.exceptions in pika
NAME
pika.exceptions - Pika specific exceptions
CLASSES
builtins.Exception(builtins.BaseException)
AMQPError
AMQPChannelError
ChannelClosed
ChannelClosedByBroker
ChannelClosedByClient
ChannelWrongStateError
ConsumerCancelled
DuplicateConsumerTag
NackError
UnroutableError
AMQPConnectionError
AMQPHeartbeatTimeout
AuthenticationError
ConnectionBlockedTimeout
ConnectionClosed
ConnectionClosedByBroker
ConnectionClosedByClient
ConnectionOpenAborted
ConnectionWrongStateError
IncompatibleProtocolError
NoFreeChannels
ProbableAccessDeniedError
ProbableAuthenticationError
StreamLostError
InvalidChannelNumber
MethodNotImplemented
ProtocolSyntaxError
BodyTooLongError
InvalidFieldTypeException
InvalidFrameError
ProtocolVersionMismatch
UnexpectedFrameError
UnsupportedAMQPFieldException
ShortStringTooLong
ChannelError
DuplicateGetOkCallback
ReentrancyError
class AMQPChannelError(AMQPError)
| Method resolution order:
| AMQPChannelError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class AMQPConnectionError(AMQPError)
| Method resolution order:
| AMQPConnectionError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class AMQPError(builtins.Exception)
| Method resolution order:
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class AMQPHeartbeatTimeout(AMQPConnectionError)
| Connection was dropped as result of heartbeat timeout.
|
| Method resolution order:
| AMQPHeartbeatTimeout
| AMQPConnectionError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods inherited from AMQPConnectionError:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class AuthenticationError(AMQPConnectionError)
| Method resolution order:
| AuthenticationError
| AMQPConnectionError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class BodyTooLongError(ProtocolSyntaxError)
| Method resolution order:
| BodyTooLongError
| ProtocolSyntaxError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class ChannelClosed(AMQPChannelError)
| ChannelClosed(reply_code: 'int', reply_text: 'str') -> 'None'
|
| The channel closed by client or by broker
|
| Method resolution order:
| ChannelClosed
| AMQPChannelError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __init__(self, reply_code: 'int', reply_text: 'str') -> 'None'
| :param int reply_code: reply-code that was used in user's or broker's
| `Channel.Close` method. One of the AMQP-defined Channel Errors.
| NEW in v1.0.0
| :param str reply_text: reply-text that was used in user's or broker's
| `Channel.Close` method. Human-readable string corresponding to
| `reply_code`;
| NEW in v1.0.0
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| reply_code
| NEW in v1.0.0
| :rtype: int
|
| reply_text
| NEW in v1.0.0
| :rtype: str
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class ChannelClosedByBroker(ChannelClosed)
| ChannelClosedByBroker(reply_code: 'int', reply_text: 'str') -> 'None'
|
| `Channel.Close` from broker; may be passed as reason to channel's
| on-closed callback of non-blocking connection adapters or raised by
| `BlockingConnection`.
|
| NEW in v1.0.0
|
| Method resolution order:
| ChannelClosedByBroker
| ChannelClosed
| AMQPChannelError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods inherited from ChannelClosed:
|
| __init__(self, reply_code: 'int', reply_text: 'str') -> 'None'
| :param int reply_code: reply-code that was used in user's or broker's
| `Channel.Close` method. One of the AMQP-defined Channel Errors.
| NEW in v1.0.0
| :param str reply_text: reply-text that was used in user's or broker's
| `Channel.Close` method. Human-readable string corresponding to
| `reply_code`;
| NEW in v1.0.0
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Readonly properties inherited from ChannelClosed:
|
| reply_code
| NEW in v1.0.0
| :rtype: int
|
| reply_text
| NEW in v1.0.0
| :rtype: str
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class ChannelClosedByClient(ChannelClosed)
| ChannelClosedByClient(reply_code: 'int', reply_text: 'str') -> 'None'
|
| Channel closed by client upon receipt of `Channel.CloseOk`; may be passed
| as reason to channel's on-closed callback of non-blocking connection
| adapters, but not raised by `BlockingConnection`.
|
| NEW in v1.0.0
|
| Method resolution order:
| ChannelClosedByClient
| ChannelClosed
| AMQPChannelError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods inherited from ChannelClosed:
|
| __init__(self, reply_code: 'int', reply_text: 'str') -> 'None'
| :param int reply_code: reply-code that was used in user's or broker's
| `Channel.Close` method. One of the AMQP-defined Channel Errors.
| NEW in v1.0.0
| :param str reply_text: reply-text that was used in user's or broker's
| `Channel.Close` method. Human-readable string corresponding to
| `reply_code`;
| NEW in v1.0.0
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Readonly properties inherited from ChannelClosed:
|
| reply_code
| NEW in v1.0.0
| :rtype: int
|
| reply_text
| NEW in v1.0.0
| :rtype: str
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class ChannelError(builtins.Exception)
| Method resolution order:
| ChannelError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class ChannelWrongStateError(AMQPChannelError)
| Channel is in wrong state for the requested operation.
|
| Method resolution order:
| ChannelWrongStateError
| AMQPChannelError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods inherited from AMQPChannelError:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class ConnectionBlockedTimeout(AMQPConnectionError)
| RabbitMQ-specific: timed out waiting for connection.unblocked.
|
| Method resolution order:
| ConnectionBlockedTimeout
| AMQPConnectionError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods inherited from AMQPConnectionError:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class ConnectionClosed(AMQPConnectionError)
| ConnectionClosed(reply_code: 'int', reply_text: 'str') -> 'None'
|
| Method resolution order:
| ConnectionClosed
| AMQPConnectionError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __init__(self, reply_code: 'int', reply_text: 'str') -> 'None'
| :param int reply_code: reply-code that was used in user's or broker's
| `Connection.Close` method. NEW in v1.0.0
| :param str reply_text: reply-text that was used in user's or broker's
| `Connection.Close` method. Human-readable string corresponding to
| `reply_code`. NEW in v1.0.0
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| reply_code
| NEW in v1.0.0
| :rtype: int
|
| reply_text
| NEW in v1.0.0
| :rtype: str
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class ConnectionClosedByBroker(ConnectionClosed)
| ConnectionClosedByBroker(reply_code: 'int', reply_text: 'str') -> 'None'
|
| Connection.Close from broker.
|
| Method resolution order:
| ConnectionClosedByBroker
| ConnectionClosed
| AMQPConnectionError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods inherited from ConnectionClosed:
|
| __init__(self, reply_code: 'int', reply_text: 'str') -> 'None'
| :param int reply_code: reply-code that was used in user's or broker's
| `Connection.Close` method. NEW in v1.0.0
| :param str reply_text: reply-text that was used in user's or broker's
| `Connection.Close` method. Human-readable string corresponding to
| `reply_code`. NEW in v1.0.0
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Readonly properties inherited from ConnectionClosed:
|
| reply_code
| NEW in v1.0.0
| :rtype: int
|
| reply_text
| NEW in v1.0.0
| :rtype: str
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class ConnectionClosedByClient(ConnectionClosed)
| ConnectionClosedByClient(reply_code: 'int', reply_text: 'str') -> 'None'
|
| Connection was closed at request of Pika client.
|
| Method resolution order:
| ConnectionClosedByClient
| ConnectionClosed
| AMQPConnectionError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods inherited from ConnectionClosed:
|
| __init__(self, reply_code: 'int', reply_text: 'str') -> 'None'
| :param int reply_code: reply-code that was used in user's or broker's
| `Connection.Close` method. NEW in v1.0.0
| :param str reply_text: reply-text that was used in user's or broker's
| `Connection.Close` method. Human-readable string corresponding to
| `reply_code`. NEW in v1.0.0
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Readonly properties inherited from ConnectionClosed:
|
| reply_code
| NEW in v1.0.0
| :rtype: int
|
| reply_text
| NEW in v1.0.0
| :rtype: str
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class ConnectionOpenAborted(AMQPConnectionError)
| Client closed connection while opening.
|
| Method resolution order:
| ConnectionOpenAborted
| AMQPConnectionError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods inherited from AMQPConnectionError:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class ConnectionWrongStateError(AMQPConnectionError)
| Connection is in wrong state for the requested operation.
|
| Method resolution order:
| ConnectionWrongStateError
| AMQPConnectionError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class ConsumerCancelled(AMQPChannelError)
| Method resolution order:
| ConsumerCancelled
| AMQPChannelError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class DuplicateConsumerTag(AMQPChannelError)
| Method resolution order:
| DuplicateConsumerTag
| AMQPChannelError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class DuplicateGetOkCallback(ChannelError)
| Method resolution order:
| DuplicateGetOkCallback
| ChannelError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ChannelError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class IncompatibleProtocolError(AMQPConnectionError)
| Method resolution order:
| IncompatibleProtocolError
| AMQPConnectionError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class InvalidChannelNumber(AMQPError)
| Method resolution order:
| InvalidChannelNumber
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class InvalidFieldTypeException(ProtocolSyntaxError)
| Method resolution order:
| InvalidFieldTypeException
| ProtocolSyntaxError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class InvalidFrameError(ProtocolSyntaxError)
| Method resolution order:
| InvalidFrameError
| ProtocolSyntaxError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class MethodNotImplemented(AMQPError)
| Method resolution order:
| MethodNotImplemented
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods inherited from AMQPError:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class NackError(AMQPChannelError)
| NackError(messages: 'Sequence[ReturnedMessage]') -> 'None'
|
| This exception is raised when a message published in
| publisher-acknowledgements mode is Nack'ed by the broker.
|
| Used by BlockingChannel.
|
| Method resolution order:
| NackError
| AMQPChannelError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __init__(self, messages: 'Sequence[ReturnedMessage]') -> 'None'
| :param sequence(blocking_connection.ReturnedMessage) messages: Sequence
| of returned unroutable messages
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class NoFreeChannels(AMQPConnectionError)
| Method resolution order:
| NoFreeChannels
| AMQPConnectionError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class ProbableAccessDeniedError(AMQPConnectionError)
| Method resolution order:
| ProbableAccessDeniedError
| AMQPConnectionError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class ProbableAuthenticationError(AMQPConnectionError)
| Method resolution order:
| ProbableAuthenticationError
| AMQPConnectionError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class ProtocolSyntaxError(AMQPError)
| Method resolution order:
| ProtocolSyntaxError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class ProtocolVersionMismatch(ProtocolSyntaxError)
| Method resolution order:
| ProtocolVersionMismatch
| ProtocolSyntaxError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class ReentrancyError(builtins.Exception)
| The requested operation would result in unsupported recursion or
| reentrancy.
|
| Used by BlockingConnection/BlockingChannel
|
| Method resolution order:
| ReentrancyError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Data descriptors defined here:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __repr__(self, /)
| Return repr(self).
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class ShortStringTooLong(AMQPError)
| Method resolution order:
| ShortStringTooLong
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class StreamLostError(AMQPConnectionError)
| Stream (TCP) connection lost.
|
| Method resolution order:
| StreamLostError
| AMQPConnectionError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods inherited from AMQPConnectionError:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class UnexpectedFrameError(ProtocolSyntaxError)
| Method resolution order:
| UnexpectedFrameError
| ProtocolSyntaxError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class UnroutableError(AMQPChannelError)
| UnroutableError(messages: 'Sequence[ReturnedMessage]') -> 'None'
|
| Exception containing one or more unroutable messages returned by broker
| via Basic.Return.
|
| Used by BlockingChannel.
|
| In publisher-acknowledgements mode, this is raised upon receipt of Basic.Ack
| from broker; in the event of Basic.Nack from broker, `NackError` is raised
| instead
|
| Method resolution order:
| UnroutableError
| AMQPChannelError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __init__(self, messages: 'Sequence[ReturnedMessage]') -> 'None'
| :param sequence(blocking_connection.ReturnedMessage) messages: Sequence
| of returned unroutable messages
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class UnsupportedAMQPFieldException(ProtocolSyntaxError)
| Method resolution order:
| UnsupportedAMQPFieldException
| ProtocolSyntaxError
| AMQPError
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from AMQPError:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
DATA
Sequence = typing.Sequence
A generic version of collections.abc.Sequence.
TYPE_CHECKING = False
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pika\exceptions.py
pika.exchange_type
Python Library Documentation: module pika.exchange_type in pika
NAME
pika.exchange_type
CLASSES
builtins.str(builtins.object)
ExchangeType(builtins.str, enum.Enum)
enum.Enum(builtins.object)
ExchangeType(builtins.str, enum.Enum)
class ExchangeType(builtins.str, enum.Enum)
| ExchangeType(*values)
|
| Method resolution order:
| ExchangeType
| builtins.str
| enum.Enum
| builtins.object
|
| Methods defined here:
|
| __format__(self, format_spec) from enum.Enum
| Default object formatter.
|
| Return str(self) if format_spec is empty. Raise TypeError otherwise.
|
| __new__(cls, value) from enum.Enum
| Create and return a new object. See help(type) for accurate signature.
|
| __repr__(self) from enum.Enum
| Return repr(self).
|
| __str__(self) from enum.Enum
| Return str(self).
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| direct = <ExchangeType.direct: 'direct'>
|
| fanout = <ExchangeType.fanout: 'fanout'>
|
| headers = <ExchangeType.headers: 'headers'>
|
| topic = <ExchangeType.topic: 'topic'>
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.str:
|
| __add__(self, value, /)
| Return self+value.
|
| __contains__(self, key, /)
| Return bool(key in self).
|
| __eq__(self, value, /)
| Return self==value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __getitem__(self, key, /)
| Return self[key].
|
| __getnewargs__(...)
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __iter__(self, /)
| Implement iter(self).
|
| __le__(self, value, /)
| Return self<=value.
|
| __len__(self, /)
| Return len(self).
|
| __lt__(self, value, /)
| Return self<value.
|
| __mod__(self, value, /)
| Return self%value.
|
| __mul__(self, value, /)
| Return self*value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __rmod__(self, value, /)
| Return value%self.
|
| __rmul__(self, value, /)
| Return value*self.
|
| __sizeof__(self, /)
| Return the size of the string in memory, in bytes.
|
| capitalize(self, /)
| Return a capitalized version of the string.
|
| More specifically, make the first character have upper case and the rest lower
| case.
|
| casefold(self, /)
| Return a version of the string suitable for caseless comparisons.
|
| center(self, width, fillchar=' ', /)
| Return a centered string of length width.
|
| Padding is done using the specified fill character (default is a space).
|
| count(...)
| S.count(sub[, start[, end]]) -> int
|
| Return the number of non-overlapping occurrences of substring sub in
| string S[start:end]. Optional arguments start and end are
| interpreted as in slice notation.
|
| encode(self, /, encoding='utf-8', errors='strict')
| Encode the string using the codec registered for encoding.
|
| encoding
| The encoding in which to encode the string.
| errors
| The error handling scheme to use for encoding errors.
| The default is 'strict' meaning that encoding errors raise a
| UnicodeEncodeError. Other possible values are 'ignore', 'replace' and
| 'xmlcharrefreplace' as well as any other name registered with
| codecs.register_error that can handle UnicodeEncodeErrors.
|
| endswith(...)
| S.endswith(suffix[, start[, end]]) -> bool
|
| Return True if S ends with the specified suffix, False otherwise.
| With optional start, test S beginning at that position.
| With optional end, stop comparing S at that position.
| suffix can also be a tuple of strings to try.
|
| expandtabs(self, /, tabsize=8)
| Return a copy where all tab characters are expanded using spaces.
|
| If tabsize is not given, a tab size of 8 characters is assumed.
|
| find(...)
| S.find(sub[, start[, end]]) -> int
|
| Return the lowest index in S where substring sub is found,
| such that sub is contained within S[start:end]. Optional
| arguments start and end are interpreted as in slice notation.
|
| Return -1 on failure.
|
| format(...)
| S.format(*args, **kwargs) -> str
|
| Return a formatted version of S, using substitutions from args and kwargs.
| The substitutions are identified by braces ('{' and '}').
|
| format_map(...)
| S.format_map(mapping) -> str
|
| Return a formatted version of S, using substitutions from mapping.
| The substitutions are identified by braces ('{' and '}').
|
| index(...)
| S.index(sub[, start[, end]]) -> int
|
| Return the lowest index in S where substring sub is found,
| such that sub is contained within S[start:end]. Optional
| arguments start and end are interpreted as in slice notation.
|
| Raises ValueError when the substring is not found.
|
| isalnum(self, /)
| Return True if the string is an alpha-numeric string, False otherwise.
|
| A string is alpha-numeric if all characters in the string are alpha-numeric and
| there is at least one character in the string.
|
| isalpha(self, /)
| Return True if the string is an alphabetic string, False otherwise.
|
| A string is alphabetic if all characters in the string are alphabetic and there
| is at least one character in the string.
|
| isascii(self, /)
| Return True if all characters in the string are ASCII, False otherwise.
|
| ASCII characters have code points in the range U+0000-U+007F.
| Empty string is ASCII too.
|
| isdecimal(self, /)
| Return True if the string is a decimal string, False otherwise.
|
| A string is a decimal string if all characters in the string are decimal and
| there is at least one character in the string.
|
| isdigit(self, /)
| Return True if the string is a digit string, False otherwise.
|
| A string is a digit string if all characters in the string are digits and there
| is at least one character in the string.
|
| isidentifier(self, /)
| Return True if the string is a valid Python identifier, False otherwise.
|
| Call keyword.iskeyword(s) to test whether string s is a reserved identifier,
| such as "def" or "class".
|
| islower(self, /)
| Return True if the string is a lowercase string, False otherwise.
|
| A string is lowercase if all cased characters in the string are lowercase and
| there is at least one cased character in the string.
|
| isnumeric(self, /)
| Return True if the string is a numeric string, False otherwise.
|
| A string is numeric if all characters in the string are numeric and there is at
| least one character in the string.
|
| isprintable(self, /)
| Return True if the string is printable, False otherwise.
|
| A string is printable if all of its characters are considered printable in
| repr() or if it is empty.
|
| isspace(self, /)
| Return True if the string is a whitespace string, False otherwise.
|
| A string is whitespace if all characters in the string are whitespace and there
| is at least one character in the string.
|
| istitle(self, /)
| Return True if the string is a title-cased string, False otherwise.
|
| In a title-cased string, upper- and title-case characters may only
| follow uncased characters and lowercase characters only cased ones.
|
| isupper(self, /)
| Return True if the string is an uppercase string, False otherwise.
|
| A string is uppercase if all cased characters in the string are uppercase and
| there is at least one cased character in the string.
|
| join(self, iterable, /)
| Concatenate any number of strings.
|
| The string whose method is called is inserted in between each given string.
| The result is returned as a new string.
|
| Example: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs'
|
| ljust(self, width, fillchar=' ', /)
| Return a left-justified string of length width.
|
| Padding is done using the specified fill character (default is a space).
|
| lower(self, /)
| Return a copy of the string converted to lowercase.
|
| lstrip(self, chars=None, /)
| Return a copy of the string with leading whitespace removed.
|
| If chars is given and not None, remove characters in chars instead.
|
| partition(self, sep, /)
| Partition the string into three parts using the given separator.
|
| This will search for the separator in the string. If the separator is found,
| returns a 3-tuple containing the part before the separator, the separator
| itself, and the part after it.
|
| If the separator is not found, returns a 3-tuple containing the original string
| and two empty strings.
|
| removeprefix(self, prefix, /)
| Return a str with the given prefix string removed if present.
|
| If the string starts with the prefix string, return string[len(prefix):].
| Otherwise, return a copy of the original string.
|
| removesuffix(self, suffix, /)
| Return a str with the given suffix string removed if present.
|
| If the string ends with the suffix string and that suffix is not empty,
| return string[:-len(suffix)]. Otherwise, return a copy of the original
| string.
|
| replace(self, old, new, count=-1, /)
| Return a copy with all occurrences of substring old replaced by new.
|
| count
| Maximum number of occurrences to replace.
| -1 (the default value) means replace all occurrences.
|
| If the optional argument count is given, only the first count occurrences are
| replaced.
|
| rfind(...)
| S.rfind(sub[, start[, end]]) -> int
|
| Return the highest index in S where substring sub is found,
| such that sub is contained within S[start:end]. Optional
| arguments start and end are interpreted as in slice notation.
|
| Return -1 on failure.
|
| rindex(...)
| S.rindex(sub[, start[, end]]) -> int
|
| Return the highest index in S where substring sub is found,
| such that sub is contained within S[start:end]. Optional
| arguments start and end are interpreted as in slice notation.
|
| Raises ValueError when the substring is not found.
|
| rjust(self, width, fillchar=' ', /)
| Return a right-justified string of length width.
|
| Padding is done using the specified fill character (default is a space).
|
| rpartition(self, sep, /)
| Partition the string into three parts using the given separator.
|
| This will search for the separator in the string, starting at the end. If
| the separator is found, returns a 3-tuple containing the part before the
| separator, the separator itself, and the part after it.
|
| If the separator is not found, returns a 3-tuple containing two empty strings
| and the original string.
|
| rsplit(self, /, sep=None, maxsplit=-1)
| Return a list of the substrings in the string, using sep as the separator string.
|
| sep
| The separator used to split the string.
|
| When set to None (the default value), will split on any whitespace
| character (including \n \r \t \f and spaces) and will discard
| empty strings from the result.
| maxsplit
| Maximum number of splits.
| -1 (the default value) means no limit.
|
| Splitting starts at the end of the string and works to the front.
|
| rstrip(self, chars=None, /)
| Return a copy of the string with trailing whitespace removed.
|
| If chars is given and not None, remove characters in chars instead.
|
| split(self, /, sep=None, maxsplit=-1)
| Return a list of the substrings in the string, using sep as the separator string.
|
| sep
| The separator used to split the string.
|
| When set to None (the default value), will split on any whitespace
| character (including \n \r \t \f and spaces) and will discard
| empty strings from the result.
| maxsplit
| Maximum number of splits.
| -1 (the default value) means no limit.
|
| Splitting starts at the front of the string and works to the end.
|
| Note, str.split() is mainly useful for data that has been intentionally
| delimited. With natural text that includes punctuation, consider using
| the regular expression module.
|
| splitlines(self, /, keepends=False)
| Return a list of the lines in the string, breaking at line boundaries.
|
| Line breaks are not included in the resulting list unless keepends is given and
| true.
|
| startswith(...)
| S.startswith(prefix[, start[, end]]) -> bool
|
| Return True if S starts with the specified prefix, False otherwise.
| With optional start, test S beginning at that position.
| With optional end, stop comparing S at that position.
| prefix can also be a tuple of strings to try.
|
| strip(self, chars=None, /)
| Return a copy of the string with leading and trailing whitespace removed.
|
| If chars is given and not None, remove characters in chars instead.
|
| swapcase(self, /)
| Convert uppercase characters to lowercase and lowercase characters to uppercase.
|
| title(self, /)
| Return a version of the string where each word is titlecased.
|
| More specifically, words start with uppercased characters and all remaining
| cased characters have lower case.
|
| translate(self, table, /)
| Replace each character in the string using the given translation table.
|
| table
| Translation table, which must be a mapping of Unicode ordinals to
| Unicode ordinals, strings, or None.
|
| The table must implement lookup/indexing via __getitem__, for instance a
| dictionary or list. If this operation raises LookupError, the character is
| left untouched. Characters mapped to None are deleted.
|
| upper(self, /)
| Return a copy of the string converted to uppercase.
|
| zfill(self, width, /)
| Pad a numeric string with zeros on the left, to fill a field of the given width.
|
| The string is never truncated.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.str:
|
| maketrans(...)
| Return a translation table usable for str.translate().
|
| If there is only one argument, it must be a dictionary mapping Unicode
| ordinals (integers) or characters to Unicode ordinals, strings or None.
| Character keys will be then converted to ordinals.
| If there are two arguments, they must be strings of equal length, and
| in the resulting dictionary, each character in x will be mapped to the
| character at the same position in y. If there is a third argument, it
| must be a string, whose characters will be mapped to None in the result.
|
| ----------------------------------------------------------------------
| Methods inherited from enum.Enum:
|
| __dir__(self)
| Returns public methods and other interesting attributes.
|
| __init__(self, *args, **kwds)
| Initialize self. See help(type(self)) for accurate signature.
|
| __reduce_ex__(self, proto)
| Helper for pickle.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from enum.Enum:
|
| name
| The name of the Enum member.
|
| value
| The value of the Enum member.
|
| ----------------------------------------------------------------------
| Readonly properties inherited from enum.EnumType:
|
| __members__
| Returns a mapping of member name->value.
|
| This mapping lists all enum members, including aliases. Note that this
| is a read-only view of the internal mapping.
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pika\exchange_type.py
pika.frame
Python Library Documentation: module pika.frame in pika
NAME
pika.frame - Frame objects that do the frame demarshaling and marshaling.
CLASSES
pika.amqp_object.AMQPObject(builtins.object)
Frame
Body
Header
Heartbeat
Method(Frame, typing.Generic)
ProtocolHeader
class Body(Frame)
| Body(channel_number: int, fragment: bytes) -> None
|
| Body frame object mapping class. AMQP content body frames are mapped on
| to this base class for getting/setting of attributes/data.
|
| Method resolution order:
| Body
| Frame
| pika.amqp_object.AMQPObject
| builtins.object
|
| Methods defined here:
|
| __init__(self, channel_number: int, fragment: bytes) -> None
| Parameters:
|
| - channel_number: int
| - fragment: bytes
|
| marshal(self) -> bytes
| Return the AMQP binary encoded value of the frame
|
| :rtype: bytes
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| NAME = 'Body'
|
| __annotations__ = {}
|
| ----------------------------------------------------------------------
| Methods inherited from pika.amqp_object.AMQPObject:
|
| __eq__(self, other: 'object') -> 'bool'
| Return self==value.
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pika.amqp_object.AMQPObject:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from pika.amqp_object.AMQPObject:
|
| INDEX = None
|
| __hash__ = None
class Frame(pika.amqp_object.AMQPObject)
| Frame(frame_type: int, channel_number: int) -> None
|
| Base Frame object mapping. Defines a behavior for all child classes for
| assignment of core attributes and implementation of the a core _marshal
| method which child classes use to create the binary AMQP frame.
|
| Method resolution order:
| Frame
| pika.amqp_object.AMQPObject
| builtins.object
|
| Methods defined here:
|
| __init__(self, frame_type: int, channel_number: int) -> None
| Create a new instance of a frame
|
| :param int frame_type: The frame type
| :param int channel_number: The channel number for the frame
|
| marshal(self) -> bytes
| To be ended by child classes
|
| :raises NotImplementedError
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| NAME = 'Frame'
|
| __annotations__ = {}
|
| ----------------------------------------------------------------------
| Methods inherited from pika.amqp_object.AMQPObject:
|
| __eq__(self, other: 'object') -> 'bool'
| Return self==value.
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pika.amqp_object.AMQPObject:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from pika.amqp_object.AMQPObject:
|
| INDEX = None
|
| __hash__ = None
class Header(Frame)
| Header(channel_number: int, body_size: int, props: pika.spec.BasicProperties) -> None
|
| Header frame object mapping. AMQP content header frames are mapped
| on top of this class for creating or accessing their data and attributes.
|
| Method resolution order:
| Header
| Frame
| pika.amqp_object.AMQPObject
| builtins.object
|
| Methods defined here:
|
| __init__(self, channel_number: int, body_size: int, props: pika.spec.BasicProperties) -> None
| Create a new instance of a AMQP ContentHeader object
|
| :param int channel_number: The channel number for the frame
| :param int body_size: The number of bytes for the body
| :param pika.spec.BasicProperties props: Basic.Properties object
|
| marshal(self) -> bytes
| Return the AMQP binary encoded value of the frame
|
| :rtype: bytes
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| NAME = 'Header'
|
| __annotations__ = {}
|
| ----------------------------------------------------------------------
| Methods inherited from pika.amqp_object.AMQPObject:
|
| __eq__(self, other: 'object') -> 'bool'
| Return self==value.
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pika.amqp_object.AMQPObject:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from pika.amqp_object.AMQPObject:
|
| INDEX = None
|
| __hash__ = None
class Heartbeat(Frame)
| Heartbeat() -> None
|
| Heartbeat frame object mapping class. AMQP Heartbeat frames are mapped
| on to this class for a common access structure to the attributes/data
| values.
|
| Method resolution order:
| Heartbeat
| Frame
| pika.amqp_object.AMQPObject
| builtins.object
|
| Methods defined here:
|
| __init__(self) -> None
| Create a new instance of the Heartbeat frame
|
| marshal(self) -> bytes
| Return the AMQP binary encoded value of the frame
|
| :rtype: bytes
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| NAME = 'Heartbeat'
|
| __annotations__ = {}
|
| ----------------------------------------------------------------------
| Methods inherited from pika.amqp_object.AMQPObject:
|
| __eq__(self, other: 'object') -> 'bool'
| Return self==value.
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pika.amqp_object.AMQPObject:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from pika.amqp_object.AMQPObject:
|
| INDEX = None
|
| __hash__ = None
class Method(Frame, typing.Generic)
| Method(channel_number: int, method: ~_MethodT) -> None
|
| Base Method frame object mapping. AMQP method frames are mapped on top
| of this class for creating or accessing their data and attributes.
|
| Method resolution order:
| Method
| Frame
| pika.amqp_object.AMQPObject
| typing.Generic
| builtins.object
|
| Methods defined here:
|
| __init__(self, channel_number: int, method: ~_MethodT) -> None
| Create a new instance of a frame
|
| :param int channel_number: The frame type
| :param pika.Spec.Class.Method method: The AMQP Class.Method
|
| marshal(self) -> bytes
| Return the AMQP binary encoded value of the frame
|
| :rtype: bytes
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| NAME = 'METHOD'
|
| __annotations__ = {}
|
| __orig_bases__ = (<class 'pika.frame.Frame'>, typing.Generic[~_MethodT...
|
| __parameters__ = (~_MethodT,)
|
| ----------------------------------------------------------------------
| Methods inherited from pika.amqp_object.AMQPObject:
|
| __eq__(self, other: 'object') -> 'bool'
| Return self==value.
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pika.amqp_object.AMQPObject:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from pika.amqp_object.AMQPObject:
|
| INDEX = None
|
| __hash__ = None
|
| ----------------------------------------------------------------------
| Class methods inherited from typing.Generic:
|
| __class_getitem__(...)
| Parameterizes a generic class.
|
| At least, parameterizing a generic class is the *main* thing this
| method does. For example, for some generic class `Foo`, this is called
| when we do `Foo[int]` - there, with `cls=Foo` and `params=int`.
|
| However, note that this method is also called when defining generic
| classes in the first place with `class Foo[T]: ...`.
|
| __init_subclass__(...)
| Function to initialize subclasses.
class ProtocolHeader(pika.amqp_object.AMQPObject)
| ProtocolHeader(major: Optional[int] = None, minor: Optional[int] = None, revision: Optional[int] = None)
|
| AMQP Protocol header frame class which provides a pythonic interface
| for creating AMQP Protocol headers
|
| Method resolution order:
| ProtocolHeader
| pika.amqp_object.AMQPObject
| builtins.object
|
| Methods defined here:
|
| __init__(self, major: Optional[int] = None, minor: Optional[int] = None, revision: Optional[int] = None)
| Construct a Protocol Header frame object for the specified AMQP
| version
|
| :param int major: Major version number
| :param int minor: Minor version number
| :param int revision: Revision
|
| marshal(self) -> bytes
| Return the full AMQP wire protocol frame data representation of the
| ProtocolHeader frame
|
| :rtype: bytes
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| NAME = 'ProtocolHeader'
|
| __annotations__ = {}
|
| ----------------------------------------------------------------------
| Methods inherited from pika.amqp_object.AMQPObject:
|
| __eq__(self, other: 'object') -> 'bool'
| Return self==value.
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pika.amqp_object.AMQPObject:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from pika.amqp_object.AMQPObject:
|
| INDEX = None
|
| __hash__ = None
FUNCTIONS
decode_frame(data_in: bytes) -> Tuple[int, Union[pika.frame.Frame, pika.frame.ProtocolHeader, NoneType]]
Receives raw socket data and attempts to turn it into a frame.
Returns bytes used to make the frame and the frame
:param bytes data_in: The raw data stream
:rtype: tuple(bytes consumed, frame)
:raises: pika.exceptions.InvalidFrameError
DATA
LOGGER = <Logger pika.frame (WARNING)>
List = typing.List
A generic version of list.
Optional = typing.Optional
Optional[X] is equivalent to Union[X, None].
Tuple = typing.Tuple
Deprecated alias to builtins.tuple.
Tuple[X, Y] is the cross-product type of X and Y.
Example: Tuple[T1, T2] is a tuple of two elements corresponding
to type variables T1 and T2. Tuple[int, float, str] is a tuple
of an int, a float and a string.
To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
Union = typing.Union
Union type; Union[X, Y] means either X or Y.
On Python 3.10 and higher, the | operator
can also be used to denote unions;
X | Y means the same thing to the type checker as Union[X, Y].
To define a union, use e.g. Union[int, str]. Details:
- The arguments must be types and there must be at least one.
- None as an argument is a special case and is replaced by
type(None).
- Unions of unions are flattened, e.g.::
assert Union[Union[int, str], float] == Union[int, str, float]
- Unions of a single argument vanish, e.g.::
assert Union[int] == int # The constructor actually returns int
- Redundant arguments are skipped, e.g.::
assert Union[int, str, int] == Union[int, str]
- When comparing unions, the argument order is ignored, e.g.::
assert Union[int, str] == Union[str, int]
- You cannot subclass or instantiate a union.
- You can use Optional[X] as a shorthand for Union[X, None].
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pika\frame.py
pika.heartbeat
Python Library Documentation: module pika.heartbeat in pika
NAME
pika.heartbeat - Handle AMQP Heartbeats
CLASSES
builtins.object
HeartbeatChecker
class HeartbeatChecker(builtins.object)
| HeartbeatChecker(connection, timeout)
|
| Sends heartbeats to the broker. The provided timeout is used to
| determine if the connection is stale - no received heartbeats or
| other activity will close the connection. See the parameter list for more
| details.
|
| Methods defined here:
|
| __init__(self, connection, timeout)
| Create an object that will check for activity on the provided
| connection as well as receive heartbeat frames from the broker. The
| timeout parameter defines a window within which this activity must
| happen. If not, the connection is considered dead and closed.
|
| The value passed for timeout is also used to calculate an interval
| at which a heartbeat frame is sent to the broker. The interval is
| equal to the timeout value divided by two.
|
| :param pika.connection.Connection: Connection object
| :param int timeout: Connection idle timeout. If no activity occurs on the
| connection nor heartbeat frames received during the
| timeout window the connection will be closed. The
| interval used to send heartbeats is calculated from
| this value by dividing it by two.
|
| received(self)
| Called when a heartbeat is received
|
| stop(self)
| Stop the heartbeat checker
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| bytes_received_on_connection
| Return the number of bytes received by the connection bytes object.
|
| :rtype int
|
| connection_is_idle
| Returns true if the byte count hasn't changed in enough intervals
| to trip the max idle threshold.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
DATA
LOGGER = <Logger pika.heartbeat (WARNING)>
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pika\heartbeat.py
pika.logging
Python Library Documentation: package logging
NAME
logging
MODULE REFERENCE
https://docs.python.org/3.12/library/logging.html
The following documentation is automatically generated from the Python
source files. It may be incomplete, incorrect or include features that
are considered implementation detail and may vary between Python
implementations. When in doubt, consult the module reference at the
location listed above.
DESCRIPTION
Logging package for Python. Based on PEP 282 and comments thereto in
comp.lang.python.
Copyright (C) 2001-2022 Vinay Sajip. All Rights Reserved.
To use, simply 'import logging' and log away!
PACKAGE CONTENTS
config
handlers
CLASSES
builtins.object
BufferingFormatter
Filter
Formatter
LogRecord
LoggerAdapter
Filterer(builtins.object)
Handler
NullHandler
StreamHandler
FileHandler
Logger
class BufferingFormatter(builtins.object)
| BufferingFormatter(linefmt=None)
|
| A formatter suitable for formatting a number of records.
|
| Methods defined here:
|
| __init__(self, linefmt=None)
| Optionally specify a formatter which will be used to format each
| individual record.
|
| format(self, records)
| Format the specified records and return the result as a string.
|
| formatFooter(self, records)
| Return the footer string for the specified records.
|
| formatHeader(self, records)
| Return the header string for the specified records.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class FileHandler(StreamHandler)
| FileHandler(filename, mode='a', encoding=None, delay=False, errors=None)
|
| A handler class which writes formatted logging records to disk files.
|
| Method resolution order:
| FileHandler
| StreamHandler
| Handler
| Filterer
| builtins.object
|
| Methods defined here:
|
| __init__(self, filename, mode='a', encoding=None, delay=False, errors=None)
| Open the specified file and use it as the stream for logging.
|
| __repr__(self)
| Return repr(self).
|
| close(self)
| Closes the stream.
|
| emit(self, record)
| Emit a record.
|
| If the stream was not opened because 'delay' was specified in the
| constructor, open it before calling the superclass's emit.
|
| If stream is not open, current mode is 'w' and `_closed=True`, record
| will not be emitted (see Issue #42378).
|
| ----------------------------------------------------------------------
| Methods inherited from StreamHandler:
|
| flush(self)
| Flushes the stream.
|
| setStream(self, stream)
| Sets the StreamHandler's stream to the specified value,
| if it is different.
|
| Returns the old stream, if the stream was changed, or None
| if it wasn't.
|
| ----------------------------------------------------------------------
| Class methods inherited from StreamHandler:
|
| __class_getitem__ = GenericAlias(...)
| Represent a PEP 585 generic type
|
| E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from StreamHandler:
|
| terminator = '\n'
|
| ----------------------------------------------------------------------
| Methods inherited from Handler:
|
| acquire(self)
| Acquire the I/O thread lock.
|
| createLock(self)
| Acquire a thread lock for serializing access to the underlying I/O.
|
| format(self, record)
| Format the specified record.
|
| If a formatter is set, use it. Otherwise, use the default formatter
| for the module.
|
| get_name(self)
|
| handle(self, record)
| Conditionally emit the specified logging record.
|
| Emission depends on filters which may have been added to the handler.
| Wrap the actual emission of the record with acquisition/release of
| the I/O thread lock.
|
| Returns an instance of the log record that was emitted
| if it passed all filters, otherwise a false value is returned.
|
| handleError(self, record)
| Handle errors which occur during an emit() call.
|
| This method should be called from handlers when an exception is
| encountered during an emit() call. If raiseExceptions is false,
| exceptions get silently ignored. This is what is mostly wanted
| for a logging system - most users will not care about errors in
| the logging system, they are more interested in application errors.
| You could, however, replace this with a custom handler if you wish.
| The record which was being processed is passed in to this method.
|
| release(self)
| Release the I/O thread lock.
|
| setFormatter(self, fmt)
| Set the formatter for this handler.
|
| setLevel(self, level)
| Set the logging level of this handler. level must be an int or a str.
|
| set_name(self, name)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Handler:
|
| name
|
| ----------------------------------------------------------------------
| Methods inherited from Filterer:
|
| addFilter(self, filter)
| Add the specified filter to this handler.
|
| filter(self, record)
| Determine if a record is loggable by consulting all the filters.
|
| The default is to allow the record to be logged; any filter can veto
| this by returning a false value.
| If a filter attached to a handler returns a log record instance,
| then that instance is used in place of the original log record in
| any further processing of the event by that handler.
| If a filter returns any other true value, the original log record
| is used in any further processing of the event by that handler.
|
| If none of the filters return false values, this method returns
| a log record.
| If any of the filters return a false value, this method returns
| a false value.
|
| .. versionchanged:: 3.2
|
| Allow filters to be just callables.
|
| .. versionchanged:: 3.12
| Allow filters to return a LogRecord instead of
| modifying it in place.
|
| removeFilter(self, filter)
| Remove the specified filter from this handler.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Filterer:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class Filter(builtins.object)
| Filter(name='')
|
| Filter instances are used to perform arbitrary filtering of LogRecords.
|
| Loggers and Handlers can optionally use Filter instances to filter
| records as desired. The base filter class only allows events which are
| below a certain point in the logger hierarchy. For example, a filter
| initialized with "A.B" will allow events logged by loggers "A.B",
| "A.B.C", "A.B.C.D", "A.B.D" etc. but not "A.BB", "B.A.B" etc. If
| initialized with the empty string, all events are passed.
|
| Methods defined here:
|
| __init__(self, name='')
| Initialize a filter.
|
| Initialize with the name of the logger which, together with its
| children, will have its events allowed through the filter. If no
| name is specified, allow every event.
|
| filter(self, record)
| Determine if the specified record is to be logged.
|
| Returns True if the record should be logged, or False otherwise.
| If deemed appropriate, the record may be modified in-place.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class Formatter(builtins.object)
| Formatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)
|
| Formatter instances are used to convert a LogRecord to text.
|
| Formatters need to know how a LogRecord is constructed. They are
| responsible for converting a LogRecord to (usually) a string which can
| be interpreted by either a human or an external system. The base Formatter
| allows a formatting string to be specified. If none is supplied, the
| style-dependent default value, "%(message)s", "{message}", or
| "${message}", is used.
|
| The Formatter can be initialized with a format string which makes use of
| knowledge of the LogRecord attributes - e.g. the default value mentioned
| above makes use of the fact that the user's message and arguments are pre-
| formatted into a LogRecord's message attribute. Currently, the useful
| attributes in a LogRecord are described by:
|
| %(name)s Name of the logger (logging channel)
| %(levelno)s Numeric logging level for the message (DEBUG, INFO,
| WARNING, ERROR, CRITICAL)
| %(levelname)s Text logging level for the message ("DEBUG", "INFO",
| "WARNING", "ERROR", "CRITICAL")
| %(pathname)s Full pathname of the source file where the logging
| call was issued (if available)
| %(filename)s Filename portion of pathname
| %(module)s Module (name portion of filename)
| %(lineno)d Source line number where the logging call was issued
| (if available)
| %(funcName)s Function name
| %(created)f Time when the LogRecord was created (time.time()
| return value)
| %(asctime)s Textual time when the LogRecord was created
| %(msecs)d Millisecond portion of the creation time
| %(relativeCreated)d Time in milliseconds when the LogRecord was created,
| relative to the time the logging module was loaded
| (typically at application startup time)
| %(thread)d Thread ID (if available)
| %(threadName)s Thread name (if available)
| %(taskName)s Task name (if available)
| %(process)d Process ID (if available)
| %(message)s The result of record.getMessage(), computed just as
| the record is emitted
|
| Methods defined here:
|
| __init__(self, fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)
| Initialize the formatter with specified format strings.
|
| Initialize the formatter either with the specified format string, or a
| default as described above. Allow for specialized date formatting with
| the optional datefmt argument. If datefmt is omitted, you get an
| ISO8601-like (or RFC 3339-like) format.
|
| Use a style parameter of '%', '{' or '$' to specify that you want to
| use one of %-formatting, :meth:`str.format` (``{}``) formatting or
| :class:`string.Template` formatting in your format string.
|
| .. versionchanged:: 3.2
| Added the ``style`` parameter.
|
| format(self, record)
| Format the specified record as text.
|
| The record's attribute dictionary is used as the operand to a
| string formatting operation which yields the returned string.
| Before formatting the dictionary, a couple of preparatory steps
| are carried out. The message attribute of the record is computed
| using LogRecord.getMessage(). If the formatting string uses the
| time (as determined by a call to usesTime(), formatTime() is
| called to format the event time. If there is exception information,
| it is formatted using formatException() and appended to the message.
|
| formatException(self, ei)
| Format and return the specified exception information as a string.
|
| This default implementation just uses
| traceback.print_exception()
|
| formatMessage(self, record)
|
| formatStack(self, stack_info)
| This method is provided as an extension point for specialized
| formatting of stack information.
|
| The input data is a string as returned from a call to
| :func:`traceback.print_stack`, but with the last trailing newline
| removed.
|
| The base implementation just returns the value passed in.
|
| formatTime(self, record, datefmt=None)
| Return the creation time of the specified LogRecord as formatted text.
|
| This method should be called from format() by a formatter which
| wants to make use of a formatted time. This method can be overridden
| in formatters to provide for any specific requirement, but the
| basic behaviour is as follows: if datefmt (a string) is specified,
| it is used with time.strftime() to format the creation time of the
| record. Otherwise, an ISO8601-like (or RFC 3339-like) format is used.
| The resulting string is returned. This function uses a user-configurable
| function to convert the creation time to a tuple. By default,
| time.localtime() is used; to change this for a particular formatter
| instance, set the 'converter' attribute to a function with the same
| signature as time.localtime() or time.gmtime(). To change it for all
| formatters, for example if you want all logging times to be shown in GMT,
| set the 'converter' attribute in the Formatter class.
|
| usesTime(self)
| Check if the format uses the creation time of the record.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| converter = localtime(...)
| localtime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,
| tm_sec,tm_wday,tm_yday,tm_isdst)
|
| Convert seconds since the Epoch to a time tuple expressing local time.
| When 'seconds' is not passed in, convert the current time instead.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| default_msec_format = '%s,%03d'
|
| default_time_format = '%Y-%m-%d %H:%M:%S'
class Handler(Filterer)
| Handler(level=0)
|
| Handler instances dispatch logging events to specific destinations.
|
| The base handler class. Acts as a placeholder which defines the Handler
| interface. Handlers can optionally use Formatter instances to format
| records as desired. By default, no formatter is specified; in this case,
| the 'raw' message as determined by record.message is logged.
|
| Method resolution order:
| Handler
| Filterer
| builtins.object
|
| Methods defined here:
|
| __init__(self, level=0)
| Initializes the instance - basically setting the formatter to None
| and the filter list to empty.
|
| __repr__(self)
| Return repr(self).
|
| acquire(self)
| Acquire the I/O thread lock.
|
| close(self)
| Tidy up any resources used by the handler.
|
| This version removes the handler from an internal map of handlers,
| _handlers, which is used for handler lookup by name. Subclasses
| should ensure that this gets called from overridden close()
| methods.
|
| createLock(self)
| Acquire a thread lock for serializing access to the underlying I/O.
|
| emit(self, record)
| Do whatever it takes to actually log the specified logging record.
|
| This version is intended to be implemented by subclasses and so
| raises a NotImplementedError.
|
| flush(self)
| Ensure all logging output has been flushed.
|
| This version does nothing and is intended to be implemented by
| subclasses.
|
| format(self, record)
| Format the specified record.
|
| If a formatter is set, use it. Otherwise, use the default formatter
| for the module.
|
| get_name(self)
|
| handle(self, record)
| Conditionally emit the specified logging record.
|
| Emission depends on filters which may have been added to the handler.
| Wrap the actual emission of the record with acquisition/release of
| the I/O thread lock.
|
| Returns an instance of the log record that was emitted
| if it passed all filters, otherwise a false value is returned.
|
| handleError(self, record)
| Handle errors which occur during an emit() call.
|
| This method should be called from handlers when an exception is
| encountered during an emit() call. If raiseExceptions is false,
| exceptions get silently ignored. This is what is mostly wanted
| for a logging system - most users will not care about errors in
| the logging system, they are more interested in application errors.
| You could, however, replace this with a custom handler if you wish.
| The record which was being processed is passed in to this method.
|
| release(self)
| Release the I/O thread lock.
|
| setFormatter(self, fmt)
| Set the formatter for this handler.
|
| setLevel(self, level)
| Set the logging level of this handler. level must be an int or a str.
|
| set_name(self, name)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| name
|
| ----------------------------------------------------------------------
| Methods inherited from Filterer:
|
| addFilter(self, filter)
| Add the specified filter to this handler.
|
| filter(self, record)
| Determine if a record is loggable by consulting all the filters.
|
| The default is to allow the record to be logged; any filter can veto
| this by returning a false value.
| If a filter attached to a handler returns a log record instance,
| then that instance is used in place of the original log record in
| any further processing of the event by that handler.
| If a filter returns any other true value, the original log record
| is used in any further processing of the event by that handler.
|
| If none of the filters return false values, this method returns
| a log record.
| If any of the filters return a false value, this method returns
| a false value.
|
| .. versionchanged:: 3.2
|
| Allow filters to be just callables.
|
| .. versionchanged:: 3.12
| Allow filters to return a LogRecord instead of
| modifying it in place.
|
| removeFilter(self, filter)
| Remove the specified filter from this handler.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Filterer:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class LogRecord(builtins.object)
| LogRecord(name, level, pathname, lineno, msg, args, exc_info, func=None, sinfo=None, **kwargs)
|
| A LogRecord instance represents an event being logged.
|
| LogRecord instances are created every time something is logged. They
| contain all the information pertinent to the event being logged. The
| main information passed in is in msg and args, which are combined
| using str(msg) % args to create the message field of the record. The
| record also includes information such as when the record was created,
| the source line where the logging call was made, and any exception
| information to be logged.
|
| Methods defined here:
|
| __init__(self, name, level, pathname, lineno, msg, args, exc_info, func=None, sinfo=None, **kwargs)
| Initialize a logging record with interesting information.
|
| __repr__(self)
| Return repr(self).
|
| getMessage(self)
| Return the message for this LogRecord.
|
| Return the message for this LogRecord after merging any user-supplied
| arguments with the message.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class Logger(Filterer)
| Logger(name, level=0)
|
| Instances of the Logger class represent a single logging channel. A
| "logging channel" indicates an area of an application. Exactly how an
| "area" is defined is up to the application developer. Since an
| application can have any number of areas, logging channels are identified
| by a unique string. Application areas can be nested (e.g. an area
| of "input processing" might include sub-areas "read CSV files", "read
| XLS files" and "read Gnumeric files"). To cater for this natural nesting,
| channel names are organized into a namespace hierarchy where levels are
| separated by periods, much like the Java or Python package namespace. So
| in the instance given above, channel names might be "input" for the upper
| level, and "input.csv", "input.xls" and "input.gnu" for the sub-levels.
| There is no arbitrary limit to the depth of nesting.
|
| Method resolution order:
| Logger
| Filterer
| builtins.object
|
| Methods defined here:
|
| __init__(self, name, level=0)
| Initialize the logger with a name and an optional level.
|
| __reduce__(self)
| Helper for pickle.
|
| __repr__(self)
| Return repr(self).
|
| addHandler(self, hdlr)
| Add the specified handler to this logger.
|
| callHandlers(self, record)
| Pass a record to all relevant handlers.
|
| Loop through all handlers for this logger and its parents in the
| logger hierarchy. If no handler was found, output a one-off error
| message to sys.stderr. Stop searching up the hierarchy whenever a
| logger with the "propagate" attribute set to zero is found - that
| will be the last logger whose handlers are called.
|
| critical(self, msg, *args, **kwargs)
| Log 'msg % args' with severity 'CRITICAL'.
|
| To pass exception information, use the keyword argument exc_info with
| a true value, e.g.
|
| logger.critical("Houston, we have a %s", "major disaster", exc_info=True)
|
| debug(self, msg, *args, **kwargs)
| Log 'msg % args' with severity 'DEBUG'.
|
| To pass exception information, use the keyword argument exc_info with
| a true value, e.g.
|
| logger.debug("Houston, we have a %s", "thorny problem", exc_info=True)
|
| error(self, msg, *args, **kwargs)
| Log 'msg % args' with severity 'ERROR'.
|
| To pass exception information, use the keyword argument exc_info with
| a true value, e.g.
|
| logger.error("Houston, we have a %s", "major problem", exc_info=True)
|
| exception(self, msg, *args, exc_info=True, **kwargs)
| Convenience method for logging an ERROR with exception information.
|
| fatal(self, msg, *args, **kwargs)
| Don't use this method, use critical() instead.
|
| findCaller(self, stack_info=False, stacklevel=1)
| Find the stack frame of the caller so that we can note the source
| file name, line number and function name.
|
| getChild(self, suffix)
| Get a logger which is a descendant to this one.
|
| This is a convenience method, such that
|
| logging.getLogger('abc').getChild('def.ghi')
|
| is the same as
|
| logging.getLogger('abc.def.ghi')
|
| It's useful, for example, when the parent logger is named using
| __name__ rather than a literal string.
|
| getChildren(self)
|
| getEffectiveLevel(self)
| Get the effective level for this logger.
|
| Loop through this logger and its parents in the logger hierarchy,
| looking for a non-zero logging level. Return the first one found.
|
| handle(self, record)
| Call the handlers for the specified record.
|
| This method is used for unpickled records received from a socket, as
| well as those created locally. Logger-level filtering is applied.
|
| hasHandlers(self)
| See if this logger has any handlers configured.
|
| Loop through all handlers for this logger and its parents in the
| logger hierarchy. Return True if a handler was found, else False.
| Stop searching up the hierarchy whenever a logger with the "propagate"
| attribute set to zero is found - that will be the last logger which
| is checked for the existence of handlers.
|
| info(self, msg, *args, **kwargs)
| Log 'msg % args' with severity 'INFO'.
|
| To pass exception information, use the keyword argument exc_info with
| a true value, e.g.
|
| logger.info("Houston, we have a %s", "notable problem", exc_info=True)
|
| isEnabledFor(self, level)
| Is this logger enabled for level 'level'?
|
| log(self, level, msg, *args, **kwargs)
| Log 'msg % args' with the integer severity 'level'.
|
| To pass exception information, use the keyword argument exc_info with
| a true value, e.g.
|
| logger.log(level, "We have a %s", "mysterious problem", exc_info=True)
|
| makeRecord(self, name, level, fn, lno, msg, args, exc_info, func=None, extra=None, sinfo=None)
| A factory method which can be overridden in subclasses to create
| specialized LogRecords.
|
| removeHandler(self, hdlr)
| Remove the specified handler from this logger.
|
| setLevel(self, level)
| Set the logging level of this logger. level must be an int or a str.
|
| warn(self, msg, *args, **kwargs)
|
| warning(self, msg, *args, **kwargs)
| Log 'msg % args' with severity 'WARNING'.
|
| To pass exception information, use the keyword argument exc_info with
| a true value, e.g.
|
| logger.warning("Houston, we have a %s", "bit of a problem", exc_info=True)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| manager = <logging.Manager object>
|
| root = <RootLogger root (WARNING)>
|
| ----------------------------------------------------------------------
| Methods inherited from Filterer:
|
| addFilter(self, filter)
| Add the specified filter to this handler.
|
| filter(self, record)
| Determine if a record is loggable by consulting all the filters.
|
| The default is to allow the record to be logged; any filter can veto
| this by returning a false value.
| If a filter attached to a handler returns a log record instance,
| then that instance is used in place of the original log record in
| any further processing of the event by that handler.
| If a filter returns any other true value, the original log record
| is used in any further processing of the event by that handler.
|
| If none of the filters return false values, this method returns
| a log record.
| If any of the filters return a false value, this method returns
| a false value.
|
| .. versionchanged:: 3.2
|
| Allow filters to be just callables.
|
| .. versionchanged:: 3.12
| Allow filters to return a LogRecord instead of
| modifying it in place.
|
| removeFilter(self, filter)
| Remove the specified filter from this handler.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Filterer:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class LoggerAdapter(builtins.object)
| LoggerAdapter(logger, extra=None)
|
| An adapter for loggers which makes it easier to specify contextual
| information in logging output.
|
| Methods defined here:
|
| __init__(self, logger, extra=None)
| Initialize the adapter with a logger and a dict-like object which
| provides contextual information. This constructor signature allows
| easy stacking of LoggerAdapters, if so desired.
|
| You can effectively pass keyword arguments as shown in the
| following example:
|
| adapter = LoggerAdapter(someLogger, dict(p1=v1, p2="v2"))
|
| __repr__(self)
| Return repr(self).
|
| critical(self, msg, *args, **kwargs)
| Delegate a critical call to the underlying logger.
|
| debug(self, msg, *args, **kwargs)
| Delegate a debug call to the underlying logger.
|
| error(self, msg, *args, **kwargs)
| Delegate an error call to the underlying logger.
|
| exception(self, msg, *args, exc_info=True, **kwargs)
| Delegate an exception call to the underlying logger.
|
| getEffectiveLevel(self)
| Get the effective level for the underlying logger.
|
| hasHandlers(self)
| See if the underlying logger has any handlers.
|
| info(self, msg, *args, **kwargs)
| Delegate an info call to the underlying logger.
|
| isEnabledFor(self, level)
| Is this logger enabled for level 'level'?
|
| log(self, level, msg, *args, **kwargs)
| Delegate a log call to the underlying logger, after adding
| contextual information from this adapter instance.
|
| process(self, msg, kwargs)
| Process the logging message and keyword arguments passed in to
| a logging call to insert contextual information. You can either
| manipulate the message itself, the keyword args or both. Return
| the message and kwargs modified (or not) to suit your needs.
|
| Normally, you'll only need to override this one method in a
| LoggerAdapter subclass for your specific needs.
|
| setLevel(self, level)
| Set the specified level on the underlying logger.
|
| warn(self, msg, *args, **kwargs)
|
| warning(self, msg, *args, **kwargs)
| Delegate a warning call to the underlying logger.
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| __class_getitem__ = GenericAlias(...)
| Represent a PEP 585 generic type
|
| E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| name
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| manager
class NullHandler(Handler)
| NullHandler(level=0)
|
| This handler does nothing. It's intended to be used to avoid the
| "No handlers could be found for logger XXX" one-off warning. This is
| important for library code, which may contain code to log events. If a user
| of the library does not configure logging, the one-off warning might be
| produced; to avoid this, the library developer simply needs to instantiate
| a NullHandler and add it to the top-level logger of the library module or
| package.
|
| Method resolution order:
| NullHandler
| Handler
| Filterer
| builtins.object
|
| Methods defined here:
|
| createLock(self)
| Acquire a thread lock for serializing access to the underlying I/O.
|
| emit(self, record)
| Stub.
|
| handle(self, record)
| Stub.
|
| ----------------------------------------------------------------------
| Methods inherited from Handler:
|
| __init__(self, level=0)
| Initializes the instance - basically setting the formatter to None
| and the filter list to empty.
|
| __repr__(self)
| Return repr(self).
|
| acquire(self)
| Acquire the I/O thread lock.
|
| close(self)
| Tidy up any resources used by the handler.
|
| This version removes the handler from an internal map of handlers,
| _handlers, which is used for handler lookup by name. Subclasses
| should ensure that this gets called from overridden close()
| methods.
|
| flush(self)
| Ensure all logging output has been flushed.
|
| This version does nothing and is intended to be implemented by
| subclasses.
|
| format(self, record)
| Format the specified record.
|
| If a formatter is set, use it. Otherwise, use the default formatter
| for the module.
|
| get_name(self)
|
| handleError(self, record)
| Handle errors which occur during an emit() call.
|
| This method should be called from handlers when an exception is
| encountered during an emit() call. If raiseExceptions is false,
| exceptions get silently ignored. This is what is mostly wanted
| for a logging system - most users will not care about errors in
| the logging system, they are more interested in application errors.
| You could, however, replace this with a custom handler if you wish.
| The record which was being processed is passed in to this method.
|
| release(self)
| Release the I/O thread lock.
|
| setFormatter(self, fmt)
| Set the formatter for this handler.
|
| setLevel(self, level)
| Set the logging level of this handler. level must be an int or a str.
|
| set_name(self, name)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Handler:
|
| name
|
| ----------------------------------------------------------------------
| Methods inherited from Filterer:
|
| addFilter(self, filter)
| Add the specified filter to this handler.
|
| filter(self, record)
| Determine if a record is loggable by consulting all the filters.
|
| The default is to allow the record to be logged; any filter can veto
| this by returning a false value.
| If a filter attached to a handler returns a log record instance,
| then that instance is used in place of the original log record in
| any further processing of the event by that handler.
| If a filter returns any other true value, the original log record
| is used in any further processing of the event by that handler.
|
| If none of the filters return false values, this method returns
| a log record.
| If any of the filters return a false value, this method returns
| a false value.
|
| .. versionchanged:: 3.2
|
| Allow filters to be just callables.
|
| .. versionchanged:: 3.12
| Allow filters to return a LogRecord instead of
| modifying it in place.
|
| removeFilter(self, filter)
| Remove the specified filter from this handler.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Filterer:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class StreamHandler(Handler)
| StreamHandler(stream=None)
|
| A handler class which writes logging records, appropriately formatted,
| to a stream. Note that this class does not close the stream, as
| sys.stdout or sys.stderr may be used.
|
| Method resolution order:
| StreamHandler
| Handler
| Filterer
| builtins.object
|
| Methods defined here:
|
| __init__(self, stream=None)
| Initialize the handler.
|
| If stream is not specified, sys.stderr is used.
|
| __repr__(self)
| Return repr(self).
|
| emit(self, record)
| Emit a record.
|
| If a formatter is specified, it is used to format the record.
| The record is then written to the stream with a trailing newline. If
| exception information is present, it is formatted using
| traceback.print_exception and appended to the stream. If the stream
| has an 'encoding' attribute, it is used to determine how to do the
| output to the stream.
|
| flush(self)
| Flushes the stream.
|
| setStream(self, stream)
| Sets the StreamHandler's stream to the specified value,
| if it is different.
|
| Returns the old stream, if the stream was changed, or None
| if it wasn't.
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| __class_getitem__ = GenericAlias(...)
| Represent a PEP 585 generic type
|
| E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| terminator = '\n'
|
| ----------------------------------------------------------------------
| Methods inherited from Handler:
|
| acquire(self)
| Acquire the I/O thread lock.
|
| close(self)
| Tidy up any resources used by the handler.
|
| This version removes the handler from an internal map of handlers,
| _handlers, which is used for handler lookup by name. Subclasses
| should ensure that this gets called from overridden close()
| methods.
|
| createLock(self)
| Acquire a thread lock for serializing access to the underlying I/O.
|
| format(self, record)
| Format the specified record.
|
| If a formatter is set, use it. Otherwise, use the default formatter
| for the module.
|
| get_name(self)
|
| handle(self, record)
| Conditionally emit the specified logging record.
|
| Emission depends on filters which may have been added to the handler.
| Wrap the actual emission of the record with acquisition/release of
| the I/O thread lock.
|
| Returns an instance of the log record that was emitted
| if it passed all filters, otherwise a false value is returned.
|
| handleError(self, record)
| Handle errors which occur during an emit() call.
|
| This method should be called from handlers when an exception is
| encountered during an emit() call. If raiseExceptions is false,
| exceptions get silently ignored. This is what is mostly wanted
| for a logging system - most users will not care about errors in
| the logging system, they are more interested in application errors.
| You could, however, replace this with a custom handler if you wish.
| The record which was being processed is passed in to this method.
|
| release(self)
| Release the I/O thread lock.
|
| setFormatter(self, fmt)
| Set the formatter for this handler.
|
| setLevel(self, level)
| Set the logging level of this handler. level must be an int or a str.
|
| set_name(self, name)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Handler:
|
| name
|
| ----------------------------------------------------------------------
| Methods inherited from Filterer:
|
| addFilter(self, filter)
| Add the specified filter to this handler.
|
| filter(self, record)
| Determine if a record is loggable by consulting all the filters.
|
| The default is to allow the record to be logged; any filter can veto
| this by returning a false value.
| If a filter attached to a handler returns a log record instance,
| then that instance is used in place of the original log record in
| any further processing of the event by that handler.
| If a filter returns any other true value, the original log record
| is used in any further processing of the event by that handler.
|
| If none of the filters return false values, this method returns
| a log record.
| If any of the filters return a false value, this method returns
| a false value.
|
| .. versionchanged:: 3.2
|
| Allow filters to be just callables.
|
| .. versionchanged:: 3.12
| Allow filters to return a LogRecord instead of
| modifying it in place.
|
| removeFilter(self, filter)
| Remove the specified filter from this handler.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Filterer:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
FUNCTIONS
addLevelName(level, levelName)
Associate 'levelName' with 'level'.
This is used when converting levels to text during message formatting.
basicConfig(**kwargs)
Do basic configuration for the logging system.
This function does nothing if the root logger already has handlers
configured, unless the keyword argument *force* is set to ``True``.
It is a convenience method intended for use by simple scripts
to do one-shot configuration of the logging package.
The default behaviour is to create a StreamHandler which writes to
sys.stderr, set a formatter using the BASIC_FORMAT format string, and
add the handler to the root logger.
A number of optional keyword arguments may be specified, which can alter
the default behaviour.
filename Specifies that a FileHandler be created, using the specified
filename, rather than a StreamHandler.
filemode Specifies the mode to open the file, if filename is specified
(if filemode is unspecified, it defaults to 'a').
format Use the specified format string for the handler.
datefmt Use the specified date/time format.
style If a format string is specified, use this to specify the
type of format string (possible values '%', '{', '$', for
%-formatting, :meth:`str.format` and :class:`string.Template`
- defaults to '%').
level Set the root logger level to the specified level.
stream Use the specified stream to initialize the StreamHandler. Note
that this argument is incompatible with 'filename' - if both
are present, 'stream' is ignored.
handlers If specified, this should be an iterable of already created
handlers, which will be added to the root logger. Any handler
in the list which does not have a formatter assigned will be
assigned the formatter created in this function.
force If this keyword is specified as true, any existing handlers
attached to the root logger are removed and closed, before
carrying out the configuration as specified by the other
arguments.
encoding If specified together with a filename, this encoding is passed to
the created FileHandler, causing it to be used when the file is
opened.
errors If specified together with a filename, this value is passed to the
created FileHandler, causing it to be used when the file is
opened in text mode. If not specified, the default value is
`backslashreplace`.
Note that you could specify a stream created using open(filename, mode)
rather than passing the filename and mode in. However, it should be
remembered that StreamHandler does not close its stream (since it may be
using sys.stdout or sys.stderr), whereas FileHandler closes its stream
when the handler is closed.
.. versionchanged:: 3.2
Added the ``style`` parameter.
.. versionchanged:: 3.3
Added the ``handlers`` parameter. A ``ValueError`` is now thrown for
incompatible arguments (e.g. ``handlers`` specified together with
``filename``/``filemode``, or ``filename``/``filemode`` specified
together with ``stream``, or ``handlers`` specified together with
``stream``.
.. versionchanged:: 3.8
Added the ``force`` parameter.
.. versionchanged:: 3.9
Added the ``encoding`` and ``errors`` parameters.
captureWarnings(capture)
If capture is true, redirect all warnings to the logging package.
If capture is False, ensure that warnings are not redirected to logging
but to their original destinations.
critical(msg, *args, **kwargs)
Log a message with severity 'CRITICAL' on the root logger. If the logger
has no handlers, call basicConfig() to add a console handler with a
pre-defined format.
debug(msg, *args, **kwargs)
Log a message with severity 'DEBUG' on the root logger. If the logger has
no handlers, call basicConfig() to add a console handler with a pre-defined
format.
disable(level=50)
Disable all logging calls of severity 'level' and below.
error(msg, *args, **kwargs)
Log a message with severity 'ERROR' on the root logger. If the logger has
no handlers, call basicConfig() to add a console handler with a pre-defined
format.
exception(msg, *args, exc_info=True, **kwargs)
Log a message with severity 'ERROR' on the root logger, with exception
information. If the logger has no handlers, basicConfig() is called to add
a console handler with a pre-defined format.
fatal(msg, *args, **kwargs)
Don't use this function, use critical() instead.
getHandlerByName(name)
Get a handler with the specified *name*, or None if there isn't one with
that name.
getHandlerNames()
Return all known handler names as an immutable set.
getLevelName(level)
Return the textual or numeric representation of logging level 'level'.
If the level is one of the predefined levels (CRITICAL, ERROR, WARNING,
INFO, DEBUG) then you get the corresponding string. If you have
associated levels with names using addLevelName then the name you have
associated with 'level' is returned.
If a numeric value corresponding to one of the defined levels is passed
in, the corresponding string representation is returned.
If a string representation of the level is passed in, the corresponding
numeric value is returned.
If no matching numeric or string value is passed in, the string
'Level %s' % level is returned.
getLevelNamesMapping()
getLogRecordFactory()
Return the factory to be used when instantiating a log record.
getLogger(name=None)
Return a logger with the specified name, creating it if necessary.
If no name is specified, return the root logger.
getLoggerClass()
Return the class to be used when instantiating a logger.
info(msg, *args, **kwargs)
Log a message with severity 'INFO' on the root logger. If the logger has
no handlers, call basicConfig() to add a console handler with a pre-defined
format.
log(level, msg, *args, **kwargs)
Log 'msg % args' with the integer severity 'level' on the root logger. If
the logger has no handlers, call basicConfig() to add a console handler
with a pre-defined format.
makeLogRecord(dict)
Make a LogRecord whose attributes are defined by the specified dictionary,
This function is useful for converting a logging event received over
a socket connection (which is sent as a dictionary) into a LogRecord
instance.
setLogRecordFactory(factory)
Set the factory to be used when instantiating a log record.
:param factory: A callable which will be called to instantiate
a log record.
setLoggerClass(klass)
Set the class to be used when instantiating a logger. The class should
define __init__() such that only a name argument is required, and the
__init__() should call Logger.__init__()
shutdown(handlerList=[<weakref at 0x00000218D5636840; to '_StderrHandler' at 0x00000218D5632900>, <weakref at 0x00000218D51D1620; to 'NullHandler' at 0x00000218D5611E50>])
Perform any cleanup actions in the logging system (e.g. flushing
buffers).
Should be called at application exit.
warn(msg, *args, **kwargs)
warning(msg, *args, **kwargs)
Log a message with severity 'WARNING' on the root logger. If the logger has
no handlers, call basicConfig() to add a console handler with a pre-defined
format.
DATA
BASIC_FORMAT = '%(levelname)s:%(name)s:%(message)s'
CRITICAL = 50
DEBUG = 10
ERROR = 40
FATAL = 50
INFO = 20
NOTSET = 0
WARN = 30
WARNING = 30
__all__ = ['BASIC_FORMAT', 'BufferingFormatter', 'CRITICAL', 'DEBUG', ...
__status__ = 'production'
lastResort = <_StderrHandler <stderr> (WARNING)>
raiseExceptions = True
VERSION
0.5.1.2
DATE
07 February 2010
AUTHOR
Vinay Sajip <vinay_sajip@red-dove.com>
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\logging\__init__.py
pika.spec
Python Library Documentation: module pika.spec in pika
NAME
pika.spec
DESCRIPTION
AMQP Specification
==================
This module implements the constants and classes that comprise AMQP protocol
level constructs. It should rarely be directly referenced outside of Pika's
own internal use.
.. note:: Auto-generated code by codegen.py, do not edit directly. Pull
requests to this file without accompanying ``utils/codegen.py`` changes will be
rejected.
CLASSES
pika.amqp_object.Class(pika.amqp_object.AMQPObject)
Access
Basic
Channel
Confirm
Connection
Exchange
Queue
Tx
pika.amqp_object.Properties(pika.amqp_object.AMQPObject)
BasicProperties
class Access(pika.amqp_object.Class)
| Method resolution order:
| Access
| pika.amqp_object.Class
| pika.amqp_object.AMQPObject
| builtins.object
|
| Data and other attributes defined here:
|
| INDEX = 30
|
| NAME = 'Access'
|
| Request = <class 'pika.spec.Access.Request'>
|
| RequestOk = <class 'pika.spec.Access.RequestOk'>
|
| __annotations__ = {}
|
| ----------------------------------------------------------------------
| Methods inherited from pika.amqp_object.AMQPObject:
|
| __eq__(self, other: 'object') -> 'bool'
| Return self==value.
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pika.amqp_object.AMQPObject:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from pika.amqp_object.AMQPObject:
|
| __hash__ = None
class Basic(pika.amqp_object.Class)
| Method resolution order:
| Basic
| pika.amqp_object.Class
| pika.amqp_object.AMQPObject
| builtins.object
|
| Data and other attributes defined here:
|
| Ack = <class 'pika.spec.Basic.Ack'>
|
| Cancel = <class 'pika.spec.Basic.Cancel'>
|
| CancelOk = <class 'pika.spec.Basic.CancelOk'>
|
| Consume = <class 'pika.spec.Basic.Consume'>
|
| ConsumeOk = <class 'pika.spec.Basic.ConsumeOk'>
|
| Deliver = <class 'pika.spec.Basic.Deliver'>
|
| Get = <class 'pika.spec.Basic.Get'>
|
| GetEmpty = <class 'pika.spec.Basic.GetEmpty'>
|
| GetOk = <class 'pika.spec.Basic.GetOk'>
|
| INDEX = 60
|
| NAME = 'Basic'
|
| Nack = <class 'pika.spec.Basic.Nack'>
|
| Publish = <class 'pika.spec.Basic.Publish'>
|
| Qos = <class 'pika.spec.Basic.Qos'>
|
| QosOk = <class 'pika.spec.Basic.QosOk'>
|
| Recover = <class 'pika.spec.Basic.Recover'>
|
| RecoverAsync = <class 'pika.spec.Basic.RecoverAsync'>
|
| RecoverOk = <class 'pika.spec.Basic.RecoverOk'>
|
| Reject = <class 'pika.spec.Basic.Reject'>
|
| Return = <class 'pika.spec.Basic.Return'>
|
| __annotations__ = {}
|
| ----------------------------------------------------------------------
| Methods inherited from pika.amqp_object.AMQPObject:
|
| __eq__(self, other: 'object') -> 'bool'
| Return self==value.
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pika.amqp_object.AMQPObject:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from pika.amqp_object.AMQPObject:
|
| __hash__ = None
class BasicProperties(pika.amqp_object.Properties)
| BasicProperties(content_type=None, content_encoding=None, headers=None, delivery_mode=None, priority=None, correlation_id=None, reply_to=None, expiration=None, message_id=None, timestamp=None, type=None, user_id=None, app_id=None, cluster_id=None)
|
| Method resolution order:
| BasicProperties
| pika.amqp_object.Properties
| pika.amqp_object.AMQPObject
| builtins.object
|
| Methods defined here:
|
| __init__(self, content_type=None, content_encoding=None, headers=None, delivery_mode=None, priority=None, correlation_id=None, reply_to=None, expiration=None, message_id=None, timestamp=None, type=None, user_id=None, app_id=None, cluster_id=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| decode(self, encoded, offset=0)
|
| encode(self)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| CLASS = <class 'pika.spec.Basic'>
|
| FLAG_APP_ID = 8
|
| FLAG_CLUSTER_ID = 4
|
| FLAG_CONTENT_ENCODING = 16384
|
| FLAG_CONTENT_TYPE = 32768
|
| FLAG_CORRELATION_ID = 1024
|
| FLAG_DELIVERY_MODE = 4096
|
| FLAG_EXPIRATION = 256
|
| FLAG_HEADERS = 8192
|
| FLAG_MESSAGE_ID = 128
|
| FLAG_PRIORITY = 2048
|
| FLAG_REPLY_TO = 512
|
| FLAG_TIMESTAMP = 64
|
| FLAG_TYPE = 32
|
| FLAG_USER_ID = 16
|
| INDEX = 60
|
| NAME = 'BasicProperties'
|
| __annotations__ = {}
|
| ----------------------------------------------------------------------
| Methods inherited from pika.amqp_object.AMQPObject:
|
| __eq__(self, other: 'object') -> 'bool'
| Return self==value.
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pika.amqp_object.AMQPObject:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from pika.amqp_object.AMQPObject:
|
| __hash__ = None
class Channel(pika.amqp_object.Class)
| Method resolution order:
| Channel
| pika.amqp_object.Class
| pika.amqp_object.AMQPObject
| builtins.object
|
| Data and other attributes defined here:
|
| Close = <class 'pika.spec.Channel.Close'>
|
| CloseOk = <class 'pika.spec.Channel.CloseOk'>
|
| Flow = <class 'pika.spec.Channel.Flow'>
|
| FlowOk = <class 'pika.spec.Channel.FlowOk'>
|
| INDEX = 20
|
| NAME = 'Channel'
|
| Open = <class 'pika.spec.Channel.Open'>
|
| OpenOk = <class 'pika.spec.Channel.OpenOk'>
|
| __annotations__ = {}
|
| ----------------------------------------------------------------------
| Methods inherited from pika.amqp_object.AMQPObject:
|
| __eq__(self, other: 'object') -> 'bool'
| Return self==value.
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pika.amqp_object.AMQPObject:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from pika.amqp_object.AMQPObject:
|
| __hash__ = None
class Confirm(pika.amqp_object.Class)
| Method resolution order:
| Confirm
| pika.amqp_object.Class
| pika.amqp_object.AMQPObject
| builtins.object
|
| Data and other attributes defined here:
|
| INDEX = 85
|
| NAME = 'Confirm'
|
| Select = <class 'pika.spec.Confirm.Select'>
|
| SelectOk = <class 'pika.spec.Confirm.SelectOk'>
|
| __annotations__ = {}
|
| ----------------------------------------------------------------------
| Methods inherited from pika.amqp_object.AMQPObject:
|
| __eq__(self, other: 'object') -> 'bool'
| Return self==value.
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pika.amqp_object.AMQPObject:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from pika.amqp_object.AMQPObject:
|
| __hash__ = None
class Connection(pika.amqp_object.Class)
| Method resolution order:
| Connection
| pika.amqp_object.Class
| pika.amqp_object.AMQPObject
| builtins.object
|
| Data and other attributes defined here:
|
| Blocked = <class 'pika.spec.Connection.Blocked'>
|
| Close = <class 'pika.spec.Connection.Close'>
|
| CloseOk = <class 'pika.spec.Connection.CloseOk'>
|
| INDEX = 10
|
| NAME = 'Connection'
|
| Open = <class 'pika.spec.Connection.Open'>
|
| OpenOk = <class 'pika.spec.Connection.OpenOk'>
|
| Secure = <class 'pika.spec.Connection.Secure'>
|
| SecureOk = <class 'pika.spec.Connection.SecureOk'>
|
| Start = <class 'pika.spec.Connection.Start'>
|
| StartOk = <class 'pika.spec.Connection.StartOk'>
|
| Tune = <class 'pika.spec.Connection.Tune'>
|
| TuneOk = <class 'pika.spec.Connection.TuneOk'>
|
| Unblocked = <class 'pika.spec.Connection.Unblocked'>
|
| UpdateSecret = <class 'pika.spec.Connection.UpdateSecret'>
|
| UpdateSecretOk = <class 'pika.spec.Connection.UpdateSecretOk'>
|
| __annotations__ = {}
|
| ----------------------------------------------------------------------
| Methods inherited from pika.amqp_object.AMQPObject:
|
| __eq__(self, other: 'object') -> 'bool'
| Return self==value.
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pika.amqp_object.AMQPObject:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from pika.amqp_object.AMQPObject:
|
| __hash__ = None
class Exchange(pika.amqp_object.Class)
| Method resolution order:
| Exchange
| pika.amqp_object.Class
| pika.amqp_object.AMQPObject
| builtins.object
|
| Data and other attributes defined here:
|
| Bind = <class 'pika.spec.Exchange.Bind'>
|
| BindOk = <class 'pika.spec.Exchange.BindOk'>
|
| Declare = <class 'pika.spec.Exchange.Declare'>
|
| DeclareOk = <class 'pika.spec.Exchange.DeclareOk'>
|
| Delete = <class 'pika.spec.Exchange.Delete'>
|
| DeleteOk = <class 'pika.spec.Exchange.DeleteOk'>
|
| INDEX = 40
|
| NAME = 'Exchange'
|
| Unbind = <class 'pika.spec.Exchange.Unbind'>
|
| UnbindOk = <class 'pika.spec.Exchange.UnbindOk'>
|
| __annotations__ = {}
|
| ----------------------------------------------------------------------
| Methods inherited from pika.amqp_object.AMQPObject:
|
| __eq__(self, other: 'object') -> 'bool'
| Return self==value.
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pika.amqp_object.AMQPObject:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from pika.amqp_object.AMQPObject:
|
| __hash__ = None
class Queue(pika.amqp_object.Class)
| Method resolution order:
| Queue
| pika.amqp_object.Class
| pika.amqp_object.AMQPObject
| builtins.object
|
| Data and other attributes defined here:
|
| Bind = <class 'pika.spec.Queue.Bind'>
|
| BindOk = <class 'pika.spec.Queue.BindOk'>
|
| Declare = <class 'pika.spec.Queue.Declare'>
|
| DeclareOk = <class 'pika.spec.Queue.DeclareOk'>
|
| Delete = <class 'pika.spec.Queue.Delete'>
|
| DeleteOk = <class 'pika.spec.Queue.DeleteOk'>
|
| INDEX = 50
|
| NAME = 'Queue'
|
| Purge = <class 'pika.spec.Queue.Purge'>
|
| PurgeOk = <class 'pika.spec.Queue.PurgeOk'>
|
| Unbind = <class 'pika.spec.Queue.Unbind'>
|
| UnbindOk = <class 'pika.spec.Queue.UnbindOk'>
|
| __annotations__ = {}
|
| ----------------------------------------------------------------------
| Methods inherited from pika.amqp_object.AMQPObject:
|
| __eq__(self, other: 'object') -> 'bool'
| Return self==value.
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pika.amqp_object.AMQPObject:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from pika.amqp_object.AMQPObject:
|
| __hash__ = None
class Tx(pika.amqp_object.Class)
| Method resolution order:
| Tx
| pika.amqp_object.Class
| pika.amqp_object.AMQPObject
| builtins.object
|
| Data and other attributes defined here:
|
| Commit = <class 'pika.spec.Tx.Commit'>
|
| CommitOk = <class 'pika.spec.Tx.CommitOk'>
|
| INDEX = 90
|
| NAME = 'Tx'
|
| Rollback = <class 'pika.spec.Tx.Rollback'>
|
| RollbackOk = <class 'pika.spec.Tx.RollbackOk'>
|
| Select = <class 'pika.spec.Tx.Select'>
|
| SelectOk = <class 'pika.spec.Tx.SelectOk'>
|
| __annotations__ = {}
|
| ----------------------------------------------------------------------
| Methods inherited from pika.amqp_object.AMQPObject:
|
| __eq__(self, other: 'object') -> 'bool'
| Return self==value.
|
| __repr__(self) -> 'str'
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from pika.amqp_object.AMQPObject:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from pika.amqp_object.AMQPObject:
|
| __hash__ = None
FUNCTIONS
has_content(methodNumber)
DATA
ACCESS_REFUSED = 403
CHANNEL_ERROR = 504
COMMAND_INVALID = 503
CONNECTION_FORCED = 320
CONTENT_TOO_LARGE = 311
FRAME_BODY = 3
FRAME_END = 206
FRAME_END_SIZE = 1
FRAME_ERROR = 501
FRAME_HEADER = 2
FRAME_HEADER_SIZE = 7
FRAME_HEARTBEAT = 8
FRAME_MAX_SIZE = 131072
FRAME_METHOD = 1
FRAME_MIN_SIZE = 4096
INTERNAL_ERROR = 541
INVALID_PATH = 402
NOT_ALLOWED = 530
NOT_FOUND = 404
NOT_IMPLEMENTED = 540
NO_CONSUMERS = 313
NO_ROUTE = 312
PERSISTENT_DELIVERY_MODE = 2
PORT = 5672
PRECONDITION_FAILED = 406
PROTOCOL_VERSION = (0, 9, 1)
REPLY_SUCCESS = 200
RESOURCE_ERROR = 506
RESOURCE_LOCKED = 405
SYNTAX_ERROR = 502
TRANSIENT_DELIVERY_MODE = 1
UNEXPECTED_FRAME = 505
methods = {655370: <class 'pika.spec.Connection.Start'>, 655371: <clas...
props = {60: <class 'pika.spec.BasicProperties'>}
str_or_bytes = (<class 'str'>, <class 'bytes'>)
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pika\spec.py
pika.tcp_socket_opts
Python Library Documentation: module pika.tcp_socket_opts in pika
NAME
pika.tcp_socket_opts - # pylint: disable=C0111
FUNCTIONS
set_sock_opts(tcp_options: Optional[Dict[str, int]], sock: socket.socket) -> None
socket_requires_keepalive(tcp_options: Dict[str, int]) -> bool
DATA
Dict = typing.Dict
A generic version of dict.
LOGGER = <Logger pika.tcp_socket_opts (WARNING)>
Optional = typing.Optional
Optional[X] is equivalent to Union[X, None].
__annotations__ = {'_SUPPORTED_TCP_OPTIONS': typing.Dict[str, int]}
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pika\tcp_socket_opts.py
pika.validators
Python Library Documentation: module pika.validators in pika
NAME
pika.validators - Common validation functions
FUNCTIONS
require_callback(callback: Callable[..., Any], callback_name: str = 'callback') -> None
Require that callback is callable and is not None
:raises: TypeError
require_string(value: Any, value_name: str) -> None
Require that value is a string
:raises: TypeError
rpc_completion_callback(callback: Optional[Callable[..., Any]]) -> bool
Verify callback is callable if not None
:returns: boolean indicating nowait
:rtype: bool
:raises: TypeError
zero_or_greater(name: str, value: int) -> None
Verify that value is zero or greater. If not, 'name'
will be used in error message
:raises: ValueError
DATA
Callable = typing.Callable
Deprecated alias to collections.abc.Callable.
Callable[[int], str] signifies a function that takes a single
parameter of type int and returns a str.
The subscription syntax must always be used with exactly two
values: the argument list and the return type.
The argument list must be a list of types, a ParamSpec,
Concatenate or ellipsis. The return type must be a single type.
There is no syntax to indicate optional or keyword arguments;
such function types are rarely used as callback types.
Optional = typing.Optional
Optional[X] is equivalent to Union[X, None].
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\pika\validators.py