Skip to content
This repository has been archived by the owner on Nov 23, 2020. It is now read-only.

Commit

Permalink
Http client use the base class connection method rather than using a …
Browse files Browse the repository at this point in the history
…diferent one #release-note=http
  • Loading branch information
lsbardel committed Feb 18, 2016
1 parent 023ca50 commit b584828
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
10 changes: 1 addition & 9 deletions pulsar/apps/http/__init__.py
Expand Up @@ -1246,7 +1246,7 @@ def _request(self, method, url, **params):
if pool is None:
host, port = request.address
pool = self.connection_pool(
partial(self._connect, host, port, request.ssl),
lambda: self.create_connection((host, port), ssl=request.ssl),
pool_size=self.pool_size, loop=self._loop)
self.connection_pools[request.key] = pool
conn = yield from pool.connect()
Expand Down Expand Up @@ -1305,14 +1305,6 @@ def ssl_context(self, verify=True, cert_reqs=None,
cafile=cafile, capath=capath,
cadata=cadata)

@asyncio.coroutine
def _connect(self, host, port, ssl):
_, connection = yield from self._loop.create_connection(
self.create_protocol, host, port, ssl=ssl)
# Wait for the connection made event
yield from connection.event('connection_made')
return connection

def _close(self, _, exc=None, async=True):
'''Close all connections.
'''
Expand Down
1 change: 1 addition & 0 deletions pulsar/async/clients.py
Expand Up @@ -233,6 +233,7 @@ def create_connection(self, address, protocol_factory=None, **kw):
host, port = address
_, protocol = yield from self._loop.create_connection(
protocol_factory, host, port, **kw)
yield from protocol.event('connection_made')
else:
raise NotImplementedError('Could not connect to %s' %
str(address))
Expand Down

0 comments on commit b584828

Please sign in to comment.