This file contains hidden or 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
'''pass_socket.py | |
Written September 14, 2012 | |
Released into the public domain. | |
Works on Python 2.6, 2.7, and may need minor changes for 3+. | |
''' | |
import multiprocessing |
This file contains hidden or 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 tornado.web | |
from multiprocessing import Pipe | |
from _multiprocessing import Connection | |
class MultiprocessApplication(tornado.web.Application): | |
def __init__(self, *args, **kwargs): | |
self._conn_main_recv, self._conn_main_send = Pipe() | |
tornado.web.Application.__init__(self, *args, **kwargs) | |
def setup(self, ioloop, is_main_process): |