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
38
votes
2 answers

Twisted server crashes unexpectedly while running django

I am running a django application on twisted using the django-on-twisted scripts from this site. All requests are served by an nginx server which reverse proxies relevant requests to twisted. I have a url setup for an API, which basically just…
tapan
  • 1,776
  • 2
  • 18
  • 31
37
votes
5 answers

Force python to use an older version of module (than what I have installed now)

My employer has a dedicated module1 we use for internal unit / system test; however, the author of this module no longer works here and I have been asked to test some devices with it. The problem is that pyfoo requires an ancient version of twisted…
Mike Pennington
  • 41,899
  • 19
  • 136
  • 174
37
votes
5 answers

Run a Scrapy spider in a Celery Task

This is not working anymore, scrapy's API has changed. Now the documentation feature a way to "Run Scrapy from a script" but I get the ReactorNotRestartable error. My task: from celery import Task from twisted.internet import reactor from…
Juan Riaza
  • 1,618
  • 2
  • 16
  • 35
36
votes
2 answers

Django Push HTTP Response to users

I currently have a very simple web application written in Django, and I would like to implement something like a callback/push notification service in my application. For example: When one user(client) uploads a photo to the server, the server…
evkwan
  • 693
  • 3
  • 9
  • 17
35
votes
2 answers

How can I find memory leaks in my Python program?

Possible Duplicate: Python memory profiler I've got a fairly complex (about 20,000) line Python program which after some development has started consuming increasing amounts of memory when it runs. What are the best tools and techniques for…
Dickon Reed
  • 3,575
  • 4
  • 23
  • 25
34
votes
3 answers

How to write a Twisted client plugin

I have used twisted to implement a client. It works fine. Now I want to be able to pass command line arguments to it, so I need to implement a twisted plugin. I have performed many searches to find resources that would show how to convert the…
user823743
  • 2,152
  • 3
  • 21
  • 31
31
votes
4 answers

Twisted + SQLAlchemy and the best way to do it

So I'm writing yet another Twisted based daemon. It'll have an xmlrpc interface as usual so I can easily communicate with it and have other processes interchange data with it as needed. This daemon needs to access a database. We've been using SQL…
Khorkrak
  • 3,911
  • 2
  • 27
  • 37
30
votes
5 answers

Sending SIGINT (Ctrl-C) to program running in Eclipse Console

I have setup a run configuration in Eclipse and need to send SIGINT (Ctrl+C) to the program. There is cleanup code in the program that runs after SIGINT, so pressing Eclipse's "Terminate" buttons won't work (they send SIGKILL I think). Typing CTRL+C…
vsekhar
  • 5,090
  • 5
  • 22
  • 23
30
votes
1 answer

Asynchronous Programming in Python Twisted

I'm having trouble developing a reverse proxy in Twisted. It works, but it seems overly complex and convoluted. So much of it feels like voodoo. Are there any simple, solid examples of asynchronous program structure on the web or in books? A sort of…
David
  • 309
  • 4
  • 3
29
votes
2 answers

Twisted or Celery? Which is right for my application with lots of SOAP calls?

I'm writing a Python application that needs both concurrency and asynchronicity. I've had a few recommendations each for Twisted and Celery, but I'm having trouble determining which is the better choice for this application (I have no experience…
Adam Levy
  • 689
  • 1
  • 8
  • 10
28
votes
3 answers

Need help understanding Comet in Python (with Django)

After spending two entire days on this I'm still finding it impossible to understand all the choices and configurations for Comet in Python. I've read all the answers here as well as every blog post I could find. It feels like I'm about to…
XOR
  • 381
  • 5
  • 4
27
votes
5 answers

Non-blocking file access with Twisted

I'm trying to figure out if there is a defacto pattern for file access using twisted. Lots of examples I've looked at (twisted.python.log, twisted.persisted.dirdbm, twisted.web.static) actually don't seem to worry about blocking for file access. It…
rhettg
  • 2,453
  • 18
  • 17
26
votes
2 answers

Stopping Twisted from swallowing exceptions

Is there a way to stop Twisted reactor from automatically swallowing exceptions (eg. NameError)? I just want it to stop execution, and give me a stack trace in console? There's even a FAQ question about it, but to say the least, it's not very…
klozovin
  • 2,363
  • 2
  • 22
  • 30
26
votes
4 answers

How do I write a setup.py for a twistd/twisted plugin that works with setuptools, distribute, etc?

The Twisted Plugin System is the preferred way to write extensible twisted applications. However, due to the way the plugin system is structured (plugins go into a twisted/plugins directory which should not be a Python package), writing a proper…
Sidnei
  • 531
  • 4
  • 8
26
votes
2 answers

How does Python's Twisted Reactor work?

Recently, I've been diving into the Twisted docs. From what I gathered, the basis of Twisted's functionality is the result of it's event loop called the "Reactor". The reactor listens for certain events and dispatches them to registered callback…
deadlock
  • 7,048
  • 14
  • 67
  • 115