Created
February 26, 2018 21:31
-
-
Save mgoldey/a3e571081243a3dc902ca1397ea19f2a to your computer and use it in GitHub Desktop.
hello world using tornado threads
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 tornado.gen | |
import tornado.process | |
import time | |
@tornado.gen.coroutine | |
def launch(pid): | |
time.sleep(0.01 * pid) | |
if pid != None: | |
print("hello, world from process {:}".format(pid + 1)) | |
def main(): | |
pid = tornado.process.fork_processes(None) | |
launch(pid) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment