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
| from time import sleep | |
| import tornado | |
| from multiprocessing.pool import ThreadPool | |
| _workers = ThreadPool(10) | |
| class BackgroundMix(tornado.web.RequestHandler): | |
| """将block任务放入线程池中执行 | |
| EXAMPLE: | |
| # blocking task like querying to MySQL |
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
| from rq import Queue, Worker, Connection | |
| if __name__ == '__main__': | |
| with Connection(): | |
| q = Queue() | |
| Worker(q).work() |
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
| #/bin/bash | |
| # Author : laomo <laomo@lmbj.net> | |
| # Donate Address : https://ripple.com//send?to=rQKFznLaiyT55YXSS33fE6NgTjKbrnN4gT | |
| sudo apt-get update | |
| sudo apt-get install libxss1 libstdc++5 ia32-libs freeglut3 | |
| #optional(for see the tasks) | |
| sudo apt-get install htop | |
| wget http://boinc.berkeley.edu/dl/boinc_7.2.33_x86_64-pc-linux-gnu.sh |
NewerOlder