Questions tagged [twisted]

Twisted is an event-driven networking engine, written in Python and implementing many different protocols.

Twisted is a multi-protocol, event-driven, liberally-licensed open-source networking engine written in Python. It is useful for implementing both clients and servers, and scales up to large websites and down to embedded devices. Twisted makes it easy to implement custom network applications.

3465 questions
226
votes
14 answers

A clean, lightweight alternative to Python's twisted?

A (long) while ago I wrote a web-spider that I multithreaded to enable concurrent requests to occur at the same time. That was in my Python youth, in the days before I knew about the GIL and the associated woes it creates for multithreaded code…
jkp
  • 78,960
  • 28
  • 103
  • 104
184
votes
4 answers

When to use Tornado, when to use Twisted / Cyclone / GEvent / other

Which of these frameworks / libraries would be the best choise for building modern multiuser web application? I would love to have an asynchronous webserver which will allow me to scale easly. What solution will give the best performance /…
Wojciech Danilo
  • 11,573
  • 17
  • 66
  • 132
105
votes
7 answers

Threads vs. Async

I have been reading up on the threaded model of programming versus the asynchronous model from this really good article. http://krondo.com/blog/?p=1209 However, the article mentions the following points. An async program will simply outperform a…
user277465
100
votes
2 answers

Caveats of select/poll vs. epoll reactors in Twisted

Everything I've read and experienced ( Tornado based apps ) leads me to believe that ePoll is a natural replacement for Select and Poll based networking, especially with Twisted. Which makes me paranoid, its pretty rare for a better technique or…
David
  • 17,673
  • 10
  • 68
  • 97
87
votes
2 answers

Python twisted: where to start

I am trying to start learning twisted for socket servers creation. I want to add some useful features (like auth, and maybe some other). Maybe someone can point me to a good tutorial which will help me to start (+ maybe some other ideas)
Oleg Tarasenko
  • 9,324
  • 18
  • 73
  • 102
84
votes
2 answers

What's so cool about Twisted?

I'm increasingly hearing that Python's Twisted framework rocks and other frameworks pale in comparison. Can anybody shed some light on this and possibly compare Twisted with other network programming frameworks.
Anton Gogolev
  • 113,561
  • 39
  • 200
  • 288
73
votes
7 answers

Why do we need to use rabbitmq

Why do we need RabbitMQ when we have a more powerful network framework in Python called Twisted. I am trying to understand the reason why someone would want to use RabbitMQ. Could you please provide a scenario or an example using RabbitMQ? Also,…
fear_matrix
  • 4,912
  • 10
  • 44
  • 65
72
votes
3 answers

What is the difference between event driven model and reactor pattern?

From the wikipedia Reactor Pattern article: The reactor design pattern is an event handling pattern for handling service requests delivered concurrently to a service handler by one or more inputs. It named a few examples, e.g. nodejs, twisted,…
Howard
  • 19,215
  • 35
  • 112
  • 184
67
votes
3 answers

Why is there a handshake failure when trying to run TLS over TLS with this code?

I tried to implement a protocol that can run TLS over TLS using twisted.protocols.tls, an interface to OpenSSL using a memory BIO. I implemented this as a protocol wrapper that mostly looks like a regular TCP transport, but which has startTLS and…
Jean-Paul Calderone
  • 47,755
  • 6
  • 94
  • 122
66
votes
2 answers

What are the use cases of Node.js vs Twisted?

Assuming a team of developers are equally comfortable with writing Javascript on the server side as they are with Python & Twisted, when is Node.js going to be more appropriate than Twisted (and vice versa)?
pmn
  • 1,640
  • 2
  • 14
  • 15
50
votes
4 answers

Is TCP Guaranteed to arrive in order?

If I send two TCP messages, do I need to handle the case where the latter arrives before the former? Or is it guaranteed to arrive in the order I send it? I assume that this is not a Twisted-specific example, because it should conform to the TCP…
Smashery
  • 57,848
  • 30
  • 97
  • 128
48
votes
3 answers

How do I add two integers together with Twisted?

I have two integers in my program; let's call them "a" and "b". I would like to add them together and get another integer as a result. These are regular Python int objects. I'm wondering; how do I add them together with Twisted? Is there a…
Glyph
  • 31,152
  • 11
  • 87
  • 129
39
votes
10 answers

ReactorNotRestartable error in while loop with scrapy

I get twisted.internet.error.ReactorNotRestartable error when I execute following code: from time import sleep from scrapy import signals from scrapy.crawler import CrawlerProcess from scrapy.utils.project import get_project_settings from…
k_wit
  • 491
  • 1
  • 4
  • 5
38
votes
3 answers

Handling large file uploads with Flask

What would be the best way to handle very large file uploads (1 GB +) with Flask? My application essentially takes multiple files assigns them one unique file number and then saves it on the server depending on where the user selected. How can we…
Infinity8
  • 615
  • 2
  • 9
  • 24
38
votes
2 answers

Python packages not installing in virtualenv using pip

I'm having trouble installing twisted pip --version pip 1.1 from /home/chris/GL/GLBackend/glenv/lib/python2.7/site-packages/pip-1.1-py2.7.egg (python 2.7) Create a virtual environment chris@chris-mint ~/GL/GLBackend $ sudo virtualenv -p…
sav
  • 2,064
  • 5
  • 25
  • 45
1
2 3
99 100