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.

-1
votes
0answers
5 views

How to send data via URL

I want to print Hello name in the web page, where the name will be given through the URL. import tornado.ioloop import tornado.web import time import wordcount class MainHandler(tornado.web....
0
votes
0answers
19 views

tornado run several concurrent functions

I need to run several function calls by Tornado concurrently with non-blocking sleep inside this function: from random import uniform import tornado.ioloop import tornado.concurrent @tornado.gen....
0
votes
0answers
15 views

Read-timeout after tornado finished request processing

I have set up a tornado service as follow: http_server = httpserver.HTTPServer(request_handler) http_server.bind(RECV_PORT, RECV_IP) http_server.start(PROCESS_NUM) ioloop.IOLoop.instance().start()op....
-1
votes
0answers
28 views

Detecting client disconnect on a tornado server

I am streaming large files via a dockerized REST service implemented in python(tornado). The stream is generated via an external program which I call using Popen(). My problem is that if a client ...
1
vote
1answer
48 views

How to make this queue parallel?

I have a queue example from here (Python+Tornado framework): https://www.tornadoweb.org/en/stable/queues.html Now it's a sequential queue. How to make it parallel? Since I don't fully understand ...
0
votes
1answer
25 views

How to refuse a websocket handshake in a tornado websocket handler

So I'm doing a unittest of a tornado server I programmed which has a websocketHandler. This is my testing code: def test_unauthorized_websocket(self): message = "Hey bro" ws = websocket....
0
votes
0answers
15 views

Tornado asych fetch [duplicate]

I am trying something simple using tornado's asynchttpclient fetch. Using fetch() on a URL using a callback. def handle_request(response): if response.error: print("Error:", response.error) ...
0
votes
1answer
59 views

Presto Singleton Class in qds-sdq-py needs to interact with different API Tokens at runtime

Our application (python 3.6) is a query generator, allowing its users to query several tables from different DataBases. We are trying to add Qubole support. Currently trying to assimilate a Presto ...
0
votes
1answer
72 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 ...
1
vote
0answers
25 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
46 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
24 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
12 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
24 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
22 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
2answers
64 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
vote
1answer
37 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
12 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
17 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
1answer
41 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
22 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
68 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
19 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
33 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
65 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
29 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
34 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
70 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
26 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
52 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
48 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
187 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
46 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
37 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
49 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
41 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
45 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
51 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
38 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
31 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
47 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(...
3
votes
1answer
54 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
45 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
24 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
27 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 ...
3
votes
1answer
53 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
18 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
30 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
47 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 ...