You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have written a code, and it was working well if my function doesnt have any yield statements, but not working when I was yielding the response as given below,
class DummyHandlerWihourYield:
@tornadoWrapper()
def get(self):
result = self.getResult()
class DummyHandlerWithYield:
@tornadoWrapper()
def get(self):
result = yield self.getResult()
def getResult(sef):
#doing some processing
Also I would like to know (becoz I am bit confused on the concepts). Lets say I have hosted a webservice,
if it doesnt have any 'yield', that means I have to support only multithreading not asynchronous - That means I need only @run_on_executor
If it is yielding any result , which means I have to support both multithreading and asynchronous. I need both @run_on_executor and @tornado.gen.coroutine
Please correct me If I am wrong here.
The text was updated successfully, but these errors were encountered:
I don't think it's possible to do what you want here. Tornado is designed to be single-threaded, and if you try to automatically use threads you'll find that you can't do the kinds of things that a handler needs to do (for example, you're only allowed to call self.finish() from the event loop thread). When you're learning to use Tornado, I recommend not using threads at all, and only introducing threads after you have a solid grasp of asynchronous concurrency within a single thread.
I have written a code, and it was working well if my function doesnt have any yield statements, but not working when I was yielding the response as given below,
Also I would like to know (becoz I am bit confused on the concepts). Lets say I have hosted a webservice,
Please correct me If I am wrong here.
The text was updated successfully, but these errors were encountered: