Questions tagged [ioloop]

16 questions
8
votes
2 answers

Shutting down a Mojo::IOLoop recurring event connected to a Mojo websocket

I'm playing around with Mojolicious and websockets. I want to send the output of multiple external commands on the server to the webpage. I have no problems with connecting and receiving messages, but I also want to send a message back to the server…
brian d foy
  • 129,424
  • 31
  • 207
  • 592
3
votes
1 answer

Running multiple instances of Tornado gives ioloop is already running error

This is how my code looks like, (have excluded some details that aren't really relevant) from multiprocessing.pool import ThreadPool as Pool class GetUsers(BaseTask): def foo(self): pool = Pool() try: …
2
votes
2 answers

Use asyncio methods on tornado's ioloop (such as create_future)

I am aware that since 5.0 tornado's ioloop is handled by asyncio and in fact the loop I get using tornado.ioloop.IOloop.current() is an asyncio loop by default. My question is how do I access the asyncio loop itself in a proper way. For example I…
MrBlaise
  • 970
  • 7
  • 21
1
vote
1 answer

Tornado ioloop instance seems to be shared across processes

In a multiprocessing application, a main process spawns multiple sub processes. Each process is meant to run its own Tornado ioloop. However, I noticed that when the process is started, all the instances of IOLoop.current() (in main and all the sub…
orange
  • 7,755
  • 14
  • 75
  • 139
1
vote
1 answer

Python Tornado: consuming external Queue from not coroutine

I have the following situation: Using python 3.6 and Tornado 5.1 to receive client requests by web socket. Some of these requests require you to invoke an external processing, which returns a queue and then deposits results periodically in it. These…
Lucas trek
  • 13
  • 3
1
vote
1 answer

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 fetch in…
trianta2
  • 3,952
  • 5
  • 36
  • 52
0
votes
0 answers

How to stop tornado.ioloop PeriodicCallback after certain retries

I am new to using tornado, struggling with a scenario when the periodic callback is made to github if for any reason github service is not reachable then IOloop.PeriodicCallBack is stuck is infinite loop. Even when the github service is restored it…
kittu
  • 3
  • 3
0
votes
1 answer

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 that Tornado doesn't like calls to its API from a…
loryruta
  • 111
  • 3
  • 9
0
votes
1 answer

How to get the number of pending task in ioloop in tornado?

I'm testing a gateway server for websocket client connection. I currently open 10000 clients to connect and send messages to my gateway server, and it echos back all the messages. When I type 'ctrl + c' to stop the process, it takes a long time to…
Badboy Lin
  • 110
  • 7
0
votes
0 answers

How to Start two application on separate IOLoop on the same port In Tornado

import tornado from tornado import httpserver from tornado import web from tornado.ioloop import IOLoop class ServiceHandler1(tornado.web.RequestHandler): def initialize(self, *args, **kwargs): print "service1 handler" class…
user2478236
  • 691
  • 12
  • 32
0
votes
2 answers

Health Check API blocked due to single IOLoop

I have a tornado application, we have two API's /health and /make call to /make API takes 10 min to build required resources and load it to memory, during which period call's to /health is blocked due to which the server is marked as unhealthy. what…
user2478236
  • 691
  • 12
  • 32
0
votes
2 answers

Stop Gracefully Tornado ioLoop

I have this async worker functionality using tornado's ioloop. I'm trying to shutdown the loop gracefully on Ctrl+C but getting the following error tornado.ioloop.TimeoutError: Operation timed out after None seconds I know I can catch it but I do…
shahaf
  • 4,750
  • 2
  • 29
  • 32
0
votes
1 answer

IOLoop/epoll/select for accepted connections

Good day. I have a question about proceeding accepted connections. I have a pythons tornado IOLoop and listening socket. When a new client is connected and this connection is accepted by tornado handler client - interaction begins. That interaction…
Ildar Gafurov
  • 13
  • 1
  • 4
0
votes
1 answer

Testing async Tornado code in the Python REPL

Say I have some function defined using Python3 tornado's async functions @gen.coroutine def translateSimple(toTranslate, commands): proc_in, proc_out = startPipeline(commands) yield gen.Task(proc_in.stdin.write, bytes(toTranslate, 'utf-8')) …
unhammer
  • 4,306
  • 2
  • 39
  • 52
0
votes
0 answers

how to resolve too many callbacks in tornado ioloop that slow down the response?

Tornado receive amounts of requests which handle in a thread pool, when tasks done it will add callbacks on IOLoop to response to the clients, so my question is how to resolve too many callbacks in tornado ioloop that slow down the response?
oo Qiao
  • 1
  • 1
1
2