Package qpid :: Module api :: Class Connection
[frames] | no frames]

Class Connection

object --+    
         |    
  Lockable --+
             |
            Connection

A Connection manages a group of Sessions and connects them with a remote endpoint.

Instance Methods
Connection
__init__(self, host, port=5672)
Creates a connection.
Session
session(self, *args, **kwargs)
Creates or retrieves the named session.
 
connect(self, *args, **kwargs)
Connect to the remote endpoint.
 
disconnect(self, *args, **kwargs)
Disconnect from the remote endpoint.
 
start(self, *args, **kwargs)
Start incoming message delivery for all sessions.
 
stop(self, *args, **kwargs)
Stop incoming message deliveries for all sessions.
 
close(self, *args, **kwargs)
Close the connection and all sessions.

Inherited from Lockable: lock, notify, notifyAll, unlock, wait

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Static Methods
Connection
open(host, port=5672)
Creates an AMQP connection and connects it to the given host and port.
Properties

Inherited from object: __class__

Method Details

open(host, port=5672)
Static Method

 

Creates an AMQP connection and connects it to the given host and port.

Parameters:
  • host (str) - the name or ip address of the remote host
  • port (int) - the port number of the remote host
Returns: Connection
a connected Connection
Decorators:
  • @static

__init__(self, host, port=5672)
(Constructor)

 

Creates a connection. A newly created connection must be connected with the Connection.connect() method before it can be started.

Parameters:
  • host (str) - the name or ip address of the remote host
  • port (int) - the port number of the remote host
Returns: Connection
a disconnected Connection
Overrides: object.__init__

session(self, *args, **kwargs)

 

Creates or retrieves the named session. If the name is omitted or None, then a unique name is chosen based on a randomly generated uuid.

Parameters:
  • name (str) - the session name
Returns: Session
the named Session
Decorators:
  • @synchronized

connect(self, *args, **kwargs)

 

Connect to the remote endpoint.

Decorators:
  • @synchronized

disconnect(self, *args, **kwargs)

 

Disconnect from the remote endpoint.

Decorators:
  • @synchronized

start(self, *args, **kwargs)

 

Start incoming message delivery for all sessions.

Decorators:
  • @synchronized

stop(self, *args, **kwargs)

 

Stop incoming message deliveries for all sessions.

Decorators:
  • @synchronized

close(self, *args, **kwargs)

 

Close the connection and all sessions.

Decorators:
  • @synchronized