Skip to main content

All Questions

-1 votes
1 answer
823 views

Python async request throwing error : object NoneType can't be used in 'await' expression

I am testing tornado websocket api with streamlit hello example application, i added a async wrapper to tornado.websocket.WebSocketHandler get method to record websocket connections # pip3 install ...
creater cloud's user avatar
0 votes
1 answer
430 views

Tornado 6.1 non-blocking request

Using Tornado, I have a POST request that takes a long time as it makes many requests to another API service and processes the data. This can take minutes to fully complete. I don't want this to block ...
DeltaFi's user avatar
  • 65
0 votes
2 answers
667 views

Write back through the callback attached to IOLoop in Tornado

There is a tricky post handler, sometimes it can take a lots of time (depending on a input values), sometimes not. What I want is to write back whenever 1 second passes, dynamically allocating the ...
kAldown's user avatar
  • 626
3 votes
2 answers
2k views

How to replace `yield gen.Task(fn, argument)` with an equivalent asyncio expression?

Problem: I am trying to update some old code (which I didn't write), which uses an outdated version of Tornado and gen.Task, to use the current version of Tornado and asyncio. This is mostly ...
hasManyStupidQuestions's user avatar
0 votes
1 answer
394 views

Tornado - How to stop all asynchronous 'await's from on_connection_close

So I have an asynchronous request handler in Tornado, that awaits for some events, after what it writes something to the client and terminates. Basically it's something like this : async def post(...
Eino Gourdin's user avatar
  • 4,576
0 votes
0 answers
183 views

Tornado performance issue with MySQLand Redis

I have a tornado server running with MySQL for DB and Redis for cache. I am using web socket to send/receive data. My code is like this: Server import logging import os.path import uuid import sys ...
aja's user avatar
  • 139
0 votes
1 answer
1k views

Combine Asyncio Tcp Server and Tornado Web Socket

I have a asycnio tcp server which is connected to 5 tcp client. import asyncio class EchoServerClientProtocol(asyncio.Protocol): def connection_made(self, transport): peername = ...
user avatar
1 vote
1 answer
218 views

What my code needs a gen.sleep to execute a function async?

I have the following code written based on Python's Tornado: def process_data(data): # To something def handler(message): if message['type'] == 'message': data = message['data'] ...
Hossein's user avatar
  • 42.1k
1 vote
1 answer
80 views

How do asynchronous tasks say they're "done" if there's one thread?

I've written asynchronous programs using Tornado and asyncio, however I've realized I don't understand how asynchronous tasks say they're done. For example, let's take a look at the asynchronous ...
caring-goat-913's user avatar
2 votes
2 answers
725 views

Can I use async and await with Tornado-redis? (Python 3.5)

Tornado 4.3 has added support for PEP 0492 which introduces async and await keywords for defining and calling asynchronous coroutines. Is it possible to use these keywords to call tornado-redis API's ...
AnisH_GuptA's user avatar
11 votes
1 answer
6k views

Tornado framework. TypeError: 'Future' object is not callable

I've started to learn Tornado framework sometime ago. I've faced the lack of documentation for unexperienced users and checked also asyncio module docs. So the problem is, that I have some simple code ...
Anton's user avatar
  • 171
3 votes
1 answer
2k views

Tornado generator resume on any future in list

Is there a behavior/pattern in tornado (or asyncio) to wait for any instead of all Futures in a list ? yield any_of([future1, future2, future3]) Say future2 is ready then the result should be: [None,...
nehz's user avatar
  • 2,182