twisted

Strategies or support for making parts of a Twisted application reloadable?

I've written a specialized JSON-RPC server and just started working my way up into the application logic and finding it is a tad annoying to constantly having to stop/restart the server to make certain changes. Previously I had a handler that ran in intervals to compare module modified time stamps with the past check then reload the mod...

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 methodology not to come with a price. Reading a couple dozen comparisons between epoll and ...

Twisted for Snow Leopard?

The Twisted download page shows that the current version for Macintosh is 8.2.0 for OS X 10.5 Are there known issues with this version of Twisted under 10.6, or is the Twisted web page just a bit out of date? ...

architecture of chat website using twisted matrix

I am willing to devlop a anonymus chat website.The website pairs 2 random people who are logged into the website and then allows them to chat to each other.Now if any one of them gets disconnected then the other will get connected to any other person who is single. Now i have some doubts regarding archicture. Each time there is a messa...

The memory usage reported by guppy differ from ps command

I am profiling my twisted server. It uses much more memory than I expected. Its memory usage grows over time. ps -o pid,rss,vsz,sz,size,command PID RSS VSZ SZ SZ COMMAND 7697 70856 102176 25544 88320 twistd -y broadcast.tac As you can see it costs 102176 KBs, namely, 99.78125 MBs. And I use guppy from a twisted manhole ...

Example for using Python Twisted with File Descriptors

I'm looking to use twisted to control communication across Linux pipes (os.pipe()) and fifos (os.mkfifo()) between a master process and a set of slave processes. While I'm positive tat it's possible to use twisted for these types of file descriptors (after all, twisted is great for tcp sockets which *nix abstracts away as file descriptor...

Interaction with twisted.internet.reactor

I am learning Twisted, especially its XMPP side. I am writing a Jabber client which must send and recieve messages. Here is my code: http://pastebin.com/m71225776 As I understood the workflow is like this: 1. I create handlers for important network events (i.e. connecting, message recieving, disconnecting, etc) 2. I run reactor. At this ...

How to create twisted.words.xish.domish.Element entirely from raw XML

I was surprised that XML basic object (twisted.words.xish.domish.Element) could not be created entirely from XML string. The most alike way is: msg = "<iq to='[email protected]' id='id123' type='get'> \ <query xmlns='http://juick.com/query#messages' mid='123456'/> \ </iq>" iq = domish.Element(('','')) iq.addRawXml(msg) ...

using django and twisted together

1)I want to devlop a website that has forums and chat.The chat and forums are linked in some way.Meaning for each thread the users can chat in the chat room for that thread or can post a reply to the forum. I was thinking of using django for forums and twisted for chat thing.Can i combine the two? The chat application devloped using twi...

How to find the source of increasing memory usage of a twisted server?

I have an audio broadcasting server written in Python and based on Twisted. It works fine, but its memory usage is increasing when there are more users on server, but the memory usage never goes down when those users get off line. As you see in following figure: You can see the curve of memory usage goes up where the curve of listener...

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...

Comunicating to server with queries through stream. What is the right way?

I'm writing my first network application. It manipulates jabber client and comunicates with some service with IQ-stanzas. But details are not important. This interaction works through twisted xmlstream (python language). Typical situations are described here: http://juick.com/help/api/xmpp/ To be short, I can send a "query" and server r...

Python,multi-threads,fetch webpages,dowload webpages

Hi,I want to batch dowload webpages in one site. There are 5000000 urls links in my 'urls.txt' file. It's about 300M. How make a multi-threads link these urls and dowload these webpages? or How batch dowload these webpages? my ideas: with open('urls.txt','r') as f: for el in f: ##fetch these urls or twisted? Is there a go...

Implementation of an async method in Python DBus

How do I implement an async method in Python DBus? An Example below: class LastfmApi(dbus.service.Object): def __init__(self): bus_name = dbus.service.BusName('fm.lastfm.api', bus=dbus.SessionBus()) dbus.service.Object.__init__(self, bus_name, '/') @dbus.service.method('fm.last.api.account', out_signature="s") ...

twisted http client

I am after an example describing the usage of Twisted's HTTP Client. After reading the excellent blog post on the internals of Twisted, I understand how the "Factory" and "Protocol" components play their role but I am unclear on how to introduce "Request" in the overall Client flow. More specifically, I need to be able to perform HTTP...

Running a Django test server under twisted web

As I'm writing an application which uses twisted web for serving async requests and Django for normal content delivery, I thought it would have been nice to have both run under the same twisted reactor through the WSGI interface of Django. I also wanted to test my app using the nice test server facility that Django offers. At first I si...

Basics of string based protocol security

I wasn't sure how to phrase this question, so apologies in advance if it's a duplicate of something else. I wanted to sanity check how I've secured my twisted based application and think I've done a good job at it, but it's been over a decade since I've written anything that uses raw or managed sockets. Authentication transaction: Cl...

How do I detect a lost client connection in a server that inherits from pb.Root?

For example, I have a client that connects to the server with the following: class MyClientFactory(pb.PBClientFactory, ReconnectingClientFactory): def __init__(self): pb.PBClientFactory.__init__(self) self.ipaddress = None def clientConnectionMade(self, broker): log.msg('Started to connect.') pb....

Pylons and Flex 3

Hi all, Has anyone used Python/Pylons as the server backend for a Flex 3 application? Does anyone have any thoughts on how well this would work? I read Bruce Eckel's article about tying Flex 3 to Twisted, and I've done Twisted programming, but for just a web service I think Pylons is simpler to use. Thanks in advance, Doug ...

performance issue when import reactor module before os.fork()

Hi,all i got a performance issue when trying to do: from twisted.internet import reactor #some codes here pid = os.fork() if not pid: #some codes blahblahblah reactor.run() this caused very low performance and i didn't find useful informations from the official documentation, i believe it because i import reactor module befor...