A connection adapter that tries to use the best polling method for the platform pika is running on.
An asynchronous connection adapter that attempts to use the fastest event loop adapter for the given platform.
Call method “callback” when pika believes backpressure is being applied.
Parameters: | callback_method (method) – The method to call |
---|
Requests a call to the given function as soon as possible in the context of this connection’s IOLoop thread.
For example, a thread may request a call to the channel.basic_ack method of a connection that is running in a different thread via
``` connection.add_callback_threadsafe(
functools.partial(channel.basic_ack, delivery_tag=...))
Parameters: | callback (method) – The callback method; must be callable. |
---|
Add a callback notification when the connection has closed. The callback will be passed the connection, the reply_code (int) and the reply_text (str), if sent by the remote server.
Parameters: | callback_method (method) – Callback to call on close |
---|
Add a callback to be notified when RabbitMQ has sent a Connection.Blocked frame indicating that RabbitMQ is low on resources. Publishers can use this to voluntarily suspend publishing, instead of relying on back pressure throttling. The callback will be passed the Connection.Blocked method frame.
See also ConnectionParameters.blocked_connection_timeout.
Parameters: | callback_method (method) – Callback to call on Connection.Blocked, having the signature callback_method(pika.frame.Method), where the method frame’s method member is of type pika.spec.Connection.Blocked |
---|
Add a callback to be notified when RabbitMQ has sent a Connection.Unblocked frame letting publishers know it’s ok to start publishing again. The callback will be passed the Connection.Unblocked method frame.
Parameters: | callback_method (method) – Callback to call on Connection.Unblocked, having the signature callback_method(pika.frame.Method), where the method frame’s method member is of type pika.spec.Connection.Unblocked |
---|
Add a callback notification when the connection has opened.
Parameters: | callback_method (method) – Callback to call when open |
---|
Add a callback notification when the connection can not be opened.
The callback method should accept the connection object that could not connect, and an optional error message.
Parameters: |
|
---|
Add the callback_method to the IOLoop timer to fire after deadline seconds. Returns a handle to the timeout
Parameters: |
|
---|---|
Return type: | str |
Specifies if the server supports basic.nack on the active connection.
Return type: | bool |
---|
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.
Parameters: |
|
---|---|
Return type: | pika.channel.Channel |
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.
Parameters: |
|
---|
Invoke if trying to reconnect to a RabbitMQ server. Constructing the Connection object should connect on its own.
Specifies if the server supports consumer cancel notification on the active connection.
Return type: | bool |
---|
Specifies if the active connection supports exchange to exchange bindings.
Return type: | bool |
---|
Returns a boolean reporting the current connection state.
Returns True if connection is in the process of closing due to client-initiated close request, but closing is not yet complete.
Returns a boolean reporting the current connection state.
Specifies if the active connection can use publisher confirmations.
Return type: | bool |
---|
Remove the timeout from the IOLoop by the ID returned from add_timeout.
Return type: | str |
---|
Alter the backpressure multiplier value. We set this to 10 by default. This value is used to raise warnings and trigger the backpressure callback.
Parameters: | value (int) – The multiplier value to set |
---|