tornado

tornado - transferring a file to cdn without blocking

I have the nginx upload module handling site uploads, but still need to transfer files (let's say 3-20mb each) to our cdn, and would rather not delegate that to a background job. What is the best way to do this with tornado without blocking other requests? Can i do this in an async callback? ...

Python approach to Web Services and/or handeling GET and POST

I have been working with python for a while now. Recently I got into Sockets with Twisted which was good for learning Telnet, SSH, and Message Passing. I wanted to take an idea and implement it in a web fashion. A week of searching and all I can really do is create a resource that handles GET and POST all to itself. And this I am told is...

Are Python global variables thread-safe?

edit: im asking if global variables are safe in a single-threaded web framework like tornado im using the mongoengine orm, which gets a database connection from a global variable: _get_db() # gets the db connection im also using tornado, a single-threaded python web framework. in one particular view, i need to grab a database conne...

What mutex/locking/waiting mechanism to use when writing a Chat application with Tornado Web Framework

We're implementing a Chat server using Tornado. The premise is simple, a user makes open an HTTP ajax connection to the Tornado server, and the Tornado server answers only when a new message appears in the chat-room. Whenever the connection closes, regardless if a new message came in or an error/timeout occurred, the client reopens the ...

Asynchronous COMET query with Tornado and Prototype

Hello everyone. I'm trying to write simple web application using Tornado and JS Prototype library. So, the client can execute long running job on server. I wish, that this job runs Asynchronously - so that others clients could view page and do some stuff there. Here what i've got: #!/usr/bin/env/ pytthon import tornado.httpserver impo...

Are there any open source C#-based non-blocking, event-based web server like Tornado?

I want to build a comet-based application and would like it to be able to sustain up to 1000 concurrent connections. As I understand, Tornado has the advantage of not spawning one thread per request thus allowing it to handle thousands of long poll requests easily. ...

Tornado streaming: flush() lagging on Safari & Chrome (Firefox is fine)

On Safari and Chrome, I won't be able to see flush() updates updating live on my page until after a certain number of flushes, or sometimes it hangs altogether on Safari. Flush updates work immediately on firefox though. I'd like to know a couple things: 1) Why does Safari and Chrome lag out at the beginning with the flush updates, an...

Can Tornado communicate with Cassandra, in Non-blocking asynchronous style?

I'm working on a web project, which have to process so many client requests. So I am considering to use Cassandra and tornado. Tornado seems to have a build-in client(tornado.httpclient.AsyncHTTPClient), which can do http Non-Blocking request. But, Cassandra uses Thrift protocol. Using Thrift, Tornado seems to be blocked while quering to...

chat application: pubsubhubbub vs xmpp

I'm unsure on the best stack to build a chat application. Currently I'm thinking of two main options: facebook tornado cons: does not use the main chat protocol xmpp but pubsubhubbub pros: i really like its simplicity for development (webserver + webframework); pubsubhubbub also seems simpler as a protocol than xmpp; and i know python...

Google App Engine - Secure Cookies

I'd been searching for a way to do cookie based authentication/sessions in Google App Engine because I don't like the idea of memcache based sessions, and I also don't like the idea of forcing users to create google accounts just to use a website. I stumbled across someone's posting that mentioned some signed cookie functions from the To...

Difference from Twisted and Tornado ?

Hi at all, I need to create a simple browser chat using a Comet webserver. So I have found Twisted and Tornado. What is the difference ? ...

How use Django with Tornado web server ?

How do I use Django with the Tornado web server? ...

Tornado or Django works with CGI ?

Hi at all, Tornado is a webserver + framework like Django but for real-time features. On my server I don't have a python module or wsgi module so I thought CGI. Is there a way to get Tornado ( or Django ) works by using CGI folder ? If yes, Could you explain me how do I do that ? ...

Live Updating Widget for 100+ concurrent users

Hi there what would you use if you had to have a div box on your website that would have to be updated constantly with new HTML content from the server. simple polling is probably not very resource inefficient - imagine also having 10'000 users and the div has to update. what is the most efficient or elegant solution for such a proble...

Is 'epoll' the essential reason that Tornadoweb(or Nginx) is so fast?

Tornadoweb and Nginx are popular web servers for the moment and many benchmarkings show that they have a better performance than Apache under certain circumstances. So my question is: Is 'epoll' the most essential reason that make them so fast? And what can I learn from that if I want to write a good socket server? ...

How to configure multiple web site with django and tornado?

On my VDS I use nginx, django and tornado. I had just one project, Now i gonna deploy another one project with a different domain name. I want to use different databases and folders. I know how to configure nginx for serving static resourses , but what about tornado? Should i run separeted instance of tornado for each project or is there...

nginx-tornado-django request timeout

We are using nginx-tornado-django to provide web services. That is, no web page frontend. The nginx server serves as a load-balancer. The server has 8 cores, so we launched 8 tornado-django processes on every server. Memcached is also deployed to gain better performance. The requests per day is about 1 million per server. We use MySQL as...

Authentication using cookie key with asynchronous callback

I need to write authentication function with asynchronous callback from remote Auth API. Simple authentication with login is working well, but authorization with cookie key, does not work. It should checks if in cookies present key "lp_login", fetch API url like async and execute on_response function. The code almost works, but I see tw...

Starting Tornado Web

Hi, I'm quite new to using Tornado Web as a web server, and am having a little difficulty keeping it running. I normally use Django and Nginx, and am used to start/stop/restarting the server. However with Tornado I'm having trouble telling it to "run" without directly executing my main python file for the site, ie "python ~/path/to/serv...

How do you call function after client finishes download from tornado web server?

I would like to be able to run some cleanup functions if and only if the client successfully completes the download of a file I'm serving using Tornado. I installed the firefox throttle tool and had it slow the connection down to dialup speed and installed this handler to generate a bunch of rubbish random text: class CrapHandler(BaseH...