Comments (12)
web.by fires up a thread; I've done it by using an external worker.
from tornado.
You probably want subprocess.
from tornado.
or celery
from tornado.
The better way to handle this is using a message queue. You push a job onto a queue and a worker picks it up and process it. Check out RabbitMQ, pyres, gearman, bealstalkd etc.
from tornado.
+1 for yashh
from tornado.
you can find an example at http://brianglass.wordpress.com/2009/11/29/asynchronous-shell-commands-with-tornado/
from tornado.
The multiprocessing package in Python 2.6 std lib works well with Tornado's IO loop.
from tornado.
I wrote a module for tornado similar to the AsyncHTTPClient just for this purpose.
http://github.com/alexdong/tornado/blob/master/tornado/async_process.py
from tornado.
Is there a way to run a set of mysql queries in parallel. Bret Taylor's post on mysql explains that they query all mysql shards in parallel. Can we do this in tornado ?
from tornado.
Well, you might want to leverage the async_process
and pipe the result into tornado.
from tornado.
Put the data (e.g. filename of the image in question) in a queue Q and process that queue in another process. Python comes already with everything you need:
http://docs.python.org/library/multiprocessing.html
If you want to do that distributed, check out ZeroMQ http://www.zeromq.org
from tornado.
Tornado 3.0 introduced tornado.process.Subprocess: http://www.tornadoweb.org/en/stable/process.html#tornado.process.Subprocess
from tornado.
Related Issues (20)
- httpclient_test: test_destructor_log is flaky on windows
- Python 3.11.5 error in ioloop.py HOT 3
- Inaccurate typing on HTTPHeaders
- py3.12: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal HOT 4
- Inaccurate typing for body/query argument getters
- High CPU consumption when upgrade to tornado > 5 HOT 2
- Can I write a single decorator combining @tornado.gen.coroutine and @run_on_executor. HOT 2
- Possible leak when exception is raised in inner coroutine HOT 1
- iostream: SSL logging is too noisy
- Tornado was blocked for more than 1 second in HOT 1
- static_url with a prefix does not work in a Template tag HOT 2
- how to handle the http stream data without using callback but based on coroutine? HOT 1
- Test fail with openssl 3.2 HOT 1
- tornado.websocket.WebSocketClosedError HOT 1
- Send 204 as HTTPError
- Tornado Websocket write message performance degradation when binary is False HOT 2
- `Subprocess.wait_for_exit` never resolves if process terminated before it is called HOT 3
- Websocket Client Handshake URI issue HOT 1
- tornado.httputil.HTTPServerRequest and tornado.web.RequestHandler HOT 1
- Please update to 3.11 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tornado.