twisted

Message queue proxy in Python + Twisted

Hi, I want to implement a lightweight Message Queue proxy. It's job is to receive messages from a web application (PHP) and send them to the Message Queue server asynchronously. The reason for this proxy is that the MQ isn't always avaliable and is sometimes lagging, or even down, but I want to make sure the messages are delivered, and ...

Is there any thorough, broad documentation of Twisted that is better than the official site?

I've been looking at twisted for a while now. It looks interesting - it seems like a good way to leverage a lot of power when writing servers. Unfortunately, in spite of writing a few web servers using twisted.web (from reading other people's source and an extremely dated O'Reilly book) I've never really felt like I had reached an affini...

Is twisted any good?

I keep hearing all this hype about Twisted for python, but i just find it plain confusing. What do you think is more simple to use? Simple sockets or implementing twisted ? ...

Would Python's Twisted library be the best case for an observer type pattern?

hi all, I'm developing a system where a queue will be filled with millions of items I need a process that reads items from the queue constantly and then sends those items out to registered clients. I'm thinking about using twisted for this, having the queue reader be a twisted server listening on a tcp port then clients can connect o...

How to detect non-graceful disconnect of Twisted on Linux?

I wrote a server based on Twisted, and I encountered a problem, some of the clients are disconnected not gracefully. For example, the user pulls out the network cable. For a while, the client on Windows is disconnected (the connectionLost is called, and it is also written in Twisted). And on the Linux server side, my connectionLost of t...

Problem with TCP server in Twisted

Hi all, I'm trying to make a simple TCP server using Twisted ,which can do some interaction between diffirent client connections.The main code is as below: #!/usr/bin/env python from twisted.internet import protocol, reactor from time import ctime #global variables PORT = 22334 connlist = {} #store all the connections ids = {} #...

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 Alchemy in place of hard coding SQL strings for our latest projects - those mostly done f...

Outgoing UDP sniffer in python?

I want to figure out whether my computer is somehow causing a UDP flood that is originating from my network. So that's my underlying problem, and what follows is simply my non-network-person attempt to hypothesize a solution using python. I'm extrapolating from recipe 13.1 ("Passing Messages with Socket Datagrams") from the python cookbo...

Server-side rendering using blender and twisted (python)

Hi everyone, The project I am working on at the moment basically takes in an image and then renders a video using blender from the command line. At the moment I am using Twisted to deal with the requests but there is certainly something that I am doing wrong as it is not working how I would like it to. You can see the jist of the progra...

how do twisted/tornado et cetera work

I understand that they work in some way distinct from making a thread per user. How exactly does that work? (Does 'non-blocking' have something to do with it?) ...

how does a non-blocking event loop work?

Twisted has a "non-blocking" event loop. I understand what a blocking event loop does (sort of, from the Wikipedia page) but can't figure out how a non-blocking one does. ...

closing a connection with twisted

Various connections - e.g. those created with twisted.web.client.getPage() seem to leak - they hang around indefinitely, since the OS time-out is measured in hours - if the server doesn't respond timely. And putting a time-out on the deferred you get back is deprecated. How can you track the requests you have open, and close them force...

Basic HTTP Parsing Using Twisted

Hey, I am a newcomer to the Python and Twisted game so excuse the ignorance I will likely be asking this question with. As a sort of first program, I am trying to write a basic HTTP server using twisted.web.sever which would simply print to screen the HTTP request, and then print to screen the HTTP response. I am trying to print the ent...

Waiting on event with Twisted and PB

I have a python app that uses multiple threads and I am curious about the best way to wait for something in python without burning cpu or locking the GIL. my app uses twisted and I spawn a thread to run a long operation so I do not stomp on the reactor thread. This long operation also spawns some threads using twisted's deferToThread t...

sound way to feed commands to twisted ssh after reactor.run()

Guys this is a question about python twisted ssh lib. All sample code even production code I saw acting as a ssh client based on twisted.conch.ssh are all interacting with server in such a mode: prepare some commands to run remotely; define call backs; kick off reactor then suspend for new feedback; After the reactor.run(), I never ...

Where can I get Twisted ? Official site seems hacked

Hello, the official site of Twisted is down (parked by advertisment). I just bought a book about Twisted Network Programming Essentials. Chapter 1 is getting Twisted and setting it up. But with the site down, I don't find where to download Twisted and get extra docs about it. Could somebody point me to a mirror ? ...

Convert HTTP Proxy to HTTPS Proxy in Twisted

Hey, Recently I have been playing around with the HTTP Proxy in twisted. After much trial and error I think I finally I have something working. What I want to know though, is how, if it is possible, do I expand this proxy to also be able to handle HTTPS pages? Here is what I've got so far: from twisted.internet import reactor from twist...

How to Log All IRC data on Channel Using Twisted?

I have a somewhat unique request. What I am looking to do is listen on a specific port for all traffic coming through via IRC protocol. I then want to log all of those messages/commands/ect. I do not, however, want to join the channel. I just want to listen and log. Is there an easy built in way to do this? I have been looking at the irc...

Templating and form processing toolkits to use with twisted.web

As the title states, I am looking for something, that will help me automate form processing (validation/rendering/etc) in twisted.web. I am also looking for a suitable templating toolkit to use with it. As for templating, it is not so much of an issue as there are a lot of libraries in python, that do it. I was considering the following...

Good Example of Twisted IRC Server?

I'm in the process of experimenting a bit with the twisted libraries for IRC servers/clients. I've found a few good examples of how to implement an IRC client but seem to find anything good on the server side of things. Could anybody provide some insight into how to create a basic IRC server in twisted? Edit: What about building off of ...