Created
May 22, 2012 19:38
-
-
Save jmkacz/2771144 to your computer and use it in GitHub Desktop.
my usage of TProcessPoolServer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import signal | |
def set_signal_handlers(server): | |
def clean_shutdown(signum, frame): | |
logging.info("Signal received: {0}".format(signum)) | |
server.stop() | |
signal.signal(signal.SIGTERM, clean_shutdown) | |
signal.signal(signal.SIGINT, clean_shutdown) | |
server = TProcessPoolServer(processor, transport, tfactory, pfactory) | |
set_signal_handlers(server) | |
server.serve() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment