Questions tagged [tornado]

Tornado is a scalable web server and web framework for Python specializing in handling thousands of simultaneous connections and real-time services.

0
votes
1answer
40 views

How to reconnect to a Web Socket when I refresh the client web page

When I refresh my client web-page, I stop receiving data from a tornado socket server. How can I reconnect to the stream? I have tried appending the connection objects to a list and then deleting the ...
0
votes
0answers
8 views

Tornado concurrent vs asynchronous request

Supposed that my web server has a load of about 100 req/sec. and I have 70% of the requests that are I/O bound and make a light task (like db queries), while a 30% are cpu bound that make a heavy task ...
2
votes
1answer
41 views

How to send a DELETE request with two arguments in the path?

I'm trying to implement a DELETE request that receives 2 arguments in the path. One for mission_id and one for virtual_obj_id. My client-side developer tried to use this API call through React on ...
0
votes
0answers
21 views

How does a function making an async call continue execution when the async call response is required to proceed?

Assume I make a hypothetically lengthy http call asynchronously in Tornado: @tornado.gen.engine def get(): response = yield asyncHTTPClient.fetch(...) # Response parsing body = response....
0
votes
0answers
10 views

incorrect order of span (tornado+aiozipkin)

I'm using tracer aiozipkin with tornado. sometimes operations displayed in incorrect order. It is happened if i use context and after finish context processes, client add some annotate to parent span.
0
votes
0answers
53 views

How can I ensure the DELETE method executes before POST?

I have this code that is supposed to first delete what's in a database before it loops through an HTML table and inserts each row into the database. However, sometimes the POST method executes once ...
0
votes
0answers
12 views

Sending a request using `tornado.httpclient.AsyncHTTPClient()` timing out (probably due to SSL handshake)

I'm using Tornado as a web server and need to send requests using tornado http client to another service. I'm facing a timeout issue when sending the request which I assume due to SSL handshake issue. ...
-1
votes
0answers
12 views

How can I clear a database table using javascript and python tornado?

I have a project that involves reading and updating a database. I have an HTML table that successfully takes information from the database table and displays it. I have made it so you can edit the ...
0
votes
0answers
21 views

How to supply a hierarchical or nested UI modules for a Tornado application instance?

Going through docs for learning purposes, I can't find much information how to solve my issue, basically we can provide a dict mapping of UI modules to an Application instance like so: from tornado....
1
vote
0answers
20 views

Custom Column layout Python API

I am working on a small project as a backend developer. Front team working on UI page which has columns such as Name, Price, Discount, etc. Now a client(user) have the privilege that he can select ...
0
votes
1answer
27 views

RuntimeError: Task got bad yield: <tornado.concurrent.Future object at 0x11b3df048>

When I asked for the API with Postman, I got the error. The error is "RuntimeError: Task got bad yield: <tornado.concurrent.Future object at 0x11b3df048>" The code (python3.7 tornado) async ...
-1
votes
0answers
12 views

ERROR:tornado.application:Exception in callback None

the Terminal always report ERROR:tornado.application:Exception in callback None Traceback (most recent call last): File "/usr/lib64/python2.7/site-packages/tornado/ioloop.py", line 886, in start ...
1
vote
1answer
29 views

running tornado python in docker: ModuleNotFoundError: No module named '__main__.config'; '__main__' is not a package

I have a tornado app with a file structure like this: projectfolder |_ Dockerfile |_ src |_ __init__.py |_ __main__.py |_ config.py My dockerfile looks like this: FROM python:3.7 EXPOSE 8888 ...
0
votes
1answer
9 views

When using @run_on_executor in tornado, the error is no current event loop in thread 'ThreadPoolExecutor-0_0'

I am executing the write_message method of websocket in the handler, I will report an error. class Test_Handler(BaseHandler): @run_on_executor def get(self): host_name = 'Win10' ...
0
votes
0answers
13 views

Header 'Proxy-Authorization' missing in HTTPS request with FoxyProxy

So I have a simple client with the following code in Python that redirects a request to a specific server: proxies = { 'http' : 'http://chan:[email protected]:8888', 'https': '...
0
votes
0answers
33 views

How to enter a running python Tornado IOLoop and execute a function once without stopping the loop

I have a tornado IOLoop running receiving data from a sensor and writing it to an SQL database every 500 ms. I have a function that I want to use to change one of the parameters of the sensor in a ...
1
vote
1answer
36 views

How to take in JSON as input to python tornado “post” method

I am trying to use tornado to do a simple get and post method. Quite new to tornado framework. For the post I would like to take in a json as input, use that input to feed into another function that I ...
0
votes
1answer
18 views

confused about how the IOLoop in Tornado picks up the Application object

new to Tornado and trying to understand the fundamentals. given their sample application: import tornado.ioloop import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): ...
2
votes
1answer
48 views

Error while deploying Tornado app to AWS Lambda

I am trying a simple "Hello World" to deploy a Python-Tornado app to AWS Lambda using Zappa. The code for the same in app.py file is: import tornado.ioloop import tornado.web class MainHandler(...
0
votes
1answer
18 views

Tornado async yield

I am trying to understand the purpose of the yield to enable async operations in Tornado but its not clear to me why it does not do an async. I have skipped the imports for brevity but this code is ...
1
vote
1answer
32 views

Put AsyncHTTPClient or other awaitable in Tornado's get method wiil create ThreadPoolExcutor automatically

How can I prevent a Tornado server from creating ThreadPoolExector automatically. env: windows 10 python 3.7 Tornado 6.0.2 import tornado.ioloop import tornado.web from tornado.httpclient import ...
0
votes
1answer
39 views

Error on deploying Python app to AWS Lambda

I have built a Python-Tornado app and am trying to deploy it to AWS Lambda using zappa. But, I am getting an error Error: Warning! Status check on the deployed lambda failed. A GET request to '/' ...
0
votes
0answers
27 views

Run pyzmq application in separate thread

I have an application (Jupyter) which I want to launch in separate thread. The application uses PyZMQ and Tornado. Currently the application won't execute in a separate thread because the thread doesn'...
0
votes
1answer
32 views

How to do log tailing in realtime efficiently and in an unblocking manner in tornado python

I have a little webapp in a tornado based python project and i need to implement realtime log tailing (one of the few things i am stuck at). The behaviour shoudl be similar to unix's tail -f. It woudl ...
0
votes
1answer
43 views

Can't install tornado

I am setting up tensorflow and i got this output: ERROR: matplotlib 1.3.1 requires nose, which is not installed. so i am doing sudo easy_install tornado and i got as output: earching for tornado ...
1
vote
1answer
24 views

dynamic handler creation in tornado web app

I am looking for a way by which I can create handlers based on configuration. Configuration will contain http verb, authorized user list and logic to execute for the given handler and verb combination....
0
votes
2answers
32 views

How do I call an async function with method run_in_executor in Python/Tornado?

I have a python file where I have a tornado request handler class with the following relevant code: executor = concurrent.futures.ThreadPoolExecutor(max_workers = 20) from tornado.platform.asyncio ...
1
vote
0answers
44 views

How to fix tornado error with “Tried to write x bytes less than Content-Length” in Python

I'm trying to create my custom handler in tornado which inheritance from StaticFileHandler which zips specific files in catalog. Here is code: import tempfile import zipfile from tornado.web import (...
0
votes
1answer
71 views

How to fix “RuntimeWarning: Enable tracemalloc to get the object allocation traceback” when using tornado.httpclient.AsyncHTTPClient?

I use tornado.httpclient.AsyncHTTPClient in my tornado web application' headler. Here is my code class CustomTornadoHandler(tornado.web.RequestHandler): def set_default_headers(self): ...
0
votes
1answer
44 views

Can't find Python modules - queue, websocketserver

Update - 30/04/19: Thanks xyres for helping me out. I changed the line into queue.Queue() and now I get the following errors: $ python3 netgrafio1.py 2019-04-30 16:58:45,470 - DEBUG - [asyncio] - ...
0
votes
1answer
34 views

Using async in spawn_callback to write causes RuntimeError: Cannot write() after finish()

I'm trying to have a background process that runs every 10 secs to write some random stuff to the web page. The page load will trigger this background process once. The async def do_something() works ...
0
votes
1answer
39 views

Tornado decorator cors headers

I have my ionic as frontend, which append a Bearer Token in each Request. My Tornado server is already configured for CORS. The problem is when I activate my decorator to check if that request has '...
0
votes
1answer
31 views

Run actions on Tornado main loop, after it starts

I'm creating a python3 tornado web server that may listen to an MQTT broker and whenever listens a new message from it, broadcasts it to the connected browsers, through web sockets. However, seems ...
1
vote
1answer
37 views

How to authenticate using OpenID in Tornado?

I'm using Tornado web server for a simple web application, and want to authenticate the user using OpenID. I'm new to Tornado, and I managed to work it using Node.js' Passport package (was testing on ...
0
votes
1answer
38 views

How to wait for the calling of request.finish() in Python/Tornado

In my python file I have two handler classes: MainHandler(tornado.web.RequestHandler) and WebSocketHandler(tornado.web.WebSocketHandler). In the MainHandler class I do the following code in the get ...
0
votes
1answer
34 views

Can tornado support 50 -100 websocket clients using its default http server without involving ngnix

I have an application which handles websocket and http requests for some basic operations and consuming push data over sockets. Nothing is very computation intensive. Some file tailing, occasional ...
1
vote
1answer
26 views

Tornado + motor, according to the motor document example, even an error

I used the motor library to query mongodb in the tornado project. According to the example of the official document, I was given an error. Who can help me with the code, thank you very much. from ...
0
votes
1answer
41 views

restrict access to certain files, folders in python tornado web server

I'm launching a tornado web server in python3, here's some simplified startup code: import tornado.ioloop, tornado.web root = os.path.dirname(__file__) startPage = 'index.html' class allStops(...
2
votes
1answer
35 views

WebSocket Handler on_close method async Implementation tornado

I am working on building a web application using tornado version 6.0.2. I am using WebSocket handler for setting up the connection with the client. Sample Server-side Implementation: from tornado ...
1
vote
0answers
43 views

await function in Python

So this is some code i have in my python file, the details of the code aren't that important, I basically use this MainHandler to deal with some requests sent to it by a connection "client". class ...
0
votes
0answers
23 views

Tornado testing with timeout response

actually i've 2 tornado running on 1 machine and from time to time they got frozen. I'm coding a script to test the response of them or the timeout but with no luck. I tried python3 -m tornado....
0
votes
1answer
26 views

Can you detect how well a client is keeping up with a stream of websocket messages?

I'm writing a video streaming service, and was thinking of streaming video via websockets. A problem I foresee is that the client has insufficient bandwidth to receive the stream, so I want to be ...
2
votes
1answer
42 views

Different behaviour for Yield and Await in case of RequestHandler write ( Tornado Web Framework )

I am using RequestHandler for making Web Based call using Tornado Web framework. Previously I was using Tornado Version 5.1.1 which supported @gen.coroutine and yield. I am moving my tornado version ...
0
votes
0answers
22 views

How to make multiple connection and achieve multiple requests in tornado?

How can I add multiple users in tornado? How multiple requests can be done by users?
0
votes
1answer
17 views

Duplicate logging issue in a python tornado app

I am running a python (v 3.6) tornado app (I believe the latest version 6.x). I am trying to remove my print() statements and use a logging module instead. First I created this get_logger() function: ...
-1
votes
1answer
29 views

Too many open files when using nginx + tornado to handle 5000 websocket connections

I'm testing my tornado gateway server which handles 5000 connections well without nginx. Then I add nginx and run 2 servers to handle 5000 connections. Unfortunately [Errno 24] Too many open files ...
0
votes
0answers
44 views

Tornado - Bad File Descriptor ioloop.py issue

I've recently re-started one of my older projects with the goal of automatisation of deployment of a certain server codebase for a game. When I reinstalled the VPS and attempted to deploy the server ...
0
votes
0answers
28 views

HTTPS Get Request in Python/Tornado handshake problem

So basically, I have three main components in my system, I will call them client, superProxy and proxyClient, all of them implemented in python files. In the client component I just use the library ...
0
votes
1answer
34 views

Python script DB connection as Pool not working, but simple connection is working

I am writing a script in python 3 that is listening to the tunnel and saving and updating data inside MySQL depend on the message received. I went into weird behavior, i did a simple connection to ...
1
vote
0answers
34 views

How to get all jobs running on TornadoScheduler?

I am using TornadoScheduler of APScheduler python package and trying to get current running jobs. Job configuration: ... scheduler = TornadoScheduler() def job(): while True: print('...