qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rafael Schloming <rafa...@redhat.com>
Subject Re: Python, C++: Connecting, creating a session
Date Wed, 11 Feb 2009 17:32:52 GMT
Jonathan Robie wrote:
> C++ seems simpler and cleaner to me here. You create a Connection 
> object, open it, then use it to create a Session object:
> 
> C++:
> =====
> 
> Connection connection;
> 
> try {
>   connection.open(host, port);
>   Session session =  connection.newSession();
> 
> 
> Python is more complex, because it requires:
> 
>    * a socket object
>    * connection.start()
>    * a unique identifier that I specify
> 
> 
> Python:
> ======
> 
> socket = connect(host, port)
> connection = Connection (sock=socket, username=user, password=password)
> connection.start()
> session = connection.session(str(uuid4()))
> 
> 
> 
> Should we make the Python API ape C++ here?

Here are my thoughts in no particular order:

  - How does the C++ connect work without a username and password?

  - I can buy adding a static convenience method similar to the C++ one, 
although I'd expect a username and password somewhere as well. I think 
we should preserve the ability to pass in a socket from an arbitrary 
source though. This can be quite handy.

  - I think the C++ API should probably permit an explicitly chosen 
session name as well, but the certainly both could default to creating 
the uuid when no session name is specified.

--Rafael

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Mime
View raw message