Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
allow ctrl-c'ing benchmark examples
Browse files Browse the repository at this point in the history
  • Loading branch information
blampe committed Aug 12, 2015
1 parent c986bf5 commit 23dca41
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 6 additions & 3 deletions examples/benchmark/thrift/client.py
Expand Up @@ -66,6 +66,9 @@ def do_work():
local.requests += 1


ioloop.PeriodicCallback(report_work, 1000).start()

resp = ioloop.IOLoop.current().run_sync(do_work)
if __name__ == '__main__':
ioloop.PeriodicCallback(report_work, 1000).start()
try:
ioloop.IOLoop.current().run_sync(do_work)
except KeyboardInterrupt:
pass
5 changes: 4 additions & 1 deletion examples/benchmark/thrift/server.py
Expand Up @@ -57,4 +57,7 @@ def run():

if __name__ == '__main__':
run()
ioloop.IOLoop.current().start()
try:
ioloop.IOLoop.current().start()
except KeyboardInterrupt:
pass

0 comments on commit 23dca41

Please sign in to comment.