diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2010-04-09 10:54:07 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2010-04-09 10:54:07 +0000 |
| commit | df0f59227e5947aa4620e8c319823e96c5796234 (patch) | |
| tree | 8455f285068e911137d753f7c390781432032373 /python/examples/api | |
| parent | 7a0d795940c5c68383b0224740f085e8e6b4e60b (diff) | |
| download | qpid-python-df0f59227e5947aa4620e8c319823e96c5796234.tar.gz | |
Changes to connection lifecycle methods and Connection parameters:
- Connection.open -> Connection.establish
- Connection.connect() split into Connection.open(), Connection.attach()
- Connection.disconnect() -> Connection.detach()
- reconnect_hosts -> reconnect_urls
- transport now takes tcp, ssl, and tcp+tls
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@932352 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/examples/api')
| -rwxr-xr-x | python/examples/api/drain | 8 | ||||
| -rwxr-xr-x | python/examples/api/server | 8 | ||||
| -rwxr-xr-x | python/examples/api/spout | 8 |
3 files changed, 6 insertions, 18 deletions
diff --git a/python/examples/api/drain b/python/examples/api/drain index 372426c801..a2e40ec8a0 100755 --- a/python/examples/api/drain +++ b/python/examples/api/drain @@ -51,7 +51,6 @@ if opts.verbose: else: enable("qpid", WARN) -url = URL(opts.broker) if args: addr = args.pop(0) else: @@ -72,15 +71,12 @@ class Formatter: def __getitem__(self, st): return eval(st, self.environ) -# XXX: should make URL default the port for us -conn = Connection(url.host, url.port, - username=url.user, - password=url.password, +conn = Connection(opts.broker, reconnect=opts.reconnect, reconnect_interval=opts.reconnect_interval, reconnect_limit=opts.reconnect_limit) try: - conn.connect() + conn.open() ssn = conn.session() rcv = ssn.receiver(addr) diff --git a/python/examples/api/server b/python/examples/api/server index 3103dd795a..0500e6f380 100755 --- a/python/examples/api/server +++ b/python/examples/api/server @@ -44,16 +44,12 @@ if opts.verbose: else: enable("qpid", WARN) -url = URL(opts.broker) if args: addr = args.pop(0) else: parser.error("address is required") -# XXX: should make URL default the port for us -conn = Connection(url.host, url.port, - username=url.user, - password=url.password, +conn = Connection(opts.broker, reconnect=opts.reconnect, reconnect_interval=opts.reconnect_interval, reconnect_limit=opts.reconnect_limit) @@ -75,7 +71,7 @@ def dispatch(msg): return result try: - conn.connect() + conn.open() ssn = conn.session() rcv = ssn.receiver(addr) diff --git a/python/examples/api/spout b/python/examples/api/spout index 9e5759b2dd..dacebb5d1a 100755 --- a/python/examples/api/spout +++ b/python/examples/api/spout @@ -65,7 +65,6 @@ if opts.verbose: else: enable("qpid", WARN) -url = URL(opts.broker) if opts.id is None: spout_id = str(uuid4()) else: @@ -92,15 +91,12 @@ if opts.entries: else: content = text -# XXX: should make URL default the port for us -conn = Connection(url.host, url.port, - username=url.user, - password=url.password, +conn = Connection(opts.broker, reconnect=opts.reconnect, reconnect_interval=opts.reconnect_interval, reconnect_limit=opts.reconnect_limit) try: - conn.connect() + conn.open() ssn = conn.session() snd = ssn.sender(addr) |
