Skip to content

Commit

Permalink
Merge pull request #25 from mrluanma/master
Browse files Browse the repository at this point in the history
Fixed examples.
  • Loading branch information
benoitc committed Aug 30, 2013
2 parents bc9f05a + f6165fe commit 4581071
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions examples/test_gevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def echo(sock, address):

def runpool(data):
with pool.connection(**options) as conn:
print ("conn: pool size: %s" % pool.size())
print ("conn: pool size: %s" % pool.size)

sent = conn.send(data)
echo_data = conn.recv(1024)
Expand All @@ -45,13 +45,13 @@ def runpool(data):
gevent.joinall(jobs)
delay = time.time() - start

print ("final pool size: %s" % pool.size())
print ("final pool size: %s" % pool.size)

with pool.connection(**options) as conn:
print ("conn: pool size: %s" % pool.size())
print ("conn: pool size: %s" % pool.size)

sent = conn.send("hello")
echo_data = conn.recv(1024)
assert "hello" == echo_data

print ("final pool size: %s" % pool.size())
print ("final pool size: %s" % pool.size)
4 changes: 2 additions & 2 deletions examples/test_threaded.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def runpool():
break
try:
with pool.connection() as conn:
print("conn: pool size: %s" % pool.size())
print("conn: pool size: %s" % pool.size)
sent = conn.send(data)
echo = conn.recv(1024)
print("got %s" % data)
Expand All @@ -91,7 +91,7 @@ def runpool():

q.join()

print ("final pool size: %s" % pool.size())
print ("final pool size: %s" % pool.size)

pool.release_all()
server.shutdown()

0 comments on commit 4581071

Please sign in to comment.