[Twisted-Python] observer patter in twisted?
hi, I want implement such situation: a client detected a message change, then it notify all the servers that registed this message arrived. Is observer patter already implemented in Twisted? BTW, in Twisted, Is a serverFactory instance one thread? thanks.
I've got a job-queue process implemented twisted that interfaces with Postgres and occasionally downloads some urls To handle the URLs, I'm using mechanize. I know that twisted.web1 has the client, but it seems to be not actively maintained, and there's no client in twisted.web2. mechanize is actively maintained and has a bunch of features that I like, so its a win win situation. except for timeouts mechanize doesn't have a timeout of its own. its using a global timeout , i think its using the default python socket timeout, and there isn't any override available. a 60s timeout doesn't work for me. i need 10s-- but i can't change the global timeout , as its in a long running process and I don't want to interfere with any of my other tasks. so I'm thinking that I somehow wrap mechanize and toss it into the event loop. rather than spend a few hours reinventing the wheel, i figure someone here *might* have done this before and can offer a pointer. anyone?
On Tue, 12 Sep 2006 21:10:26 -0400, Jonathan
I've got a job-queue process implemented twisted that interfaces with Postgres and occasionally downloads some urls
To handle the URLs, I'm using mechanize. I know that twisted.web1 has the client, but it seems to be not actively maintained, and there's no client in twisted.web2.
I'm not sure that there is much active maintenance to do. For what it's worth, I've called t.web.client.getPage() at least 10 million times, and i don't have any complaints. -- Moe Aboulkheir
On Tue, 12 Sep 2006 21:48:02 -0500, Moe Aboulkheir
On Tue, 12 Sep 2006 21:10:26 -0400, Jonathan
wrote: I've got a job-queue process implemented twisted that interfaces with Postgres and occasionally downloads some urls
To handle the URLs, I'm using mechanize. I know that twisted.web1 has the client, but it seems to be not actively maintained, and there's no client in twisted.web2.
I'm not sure that there is much active maintenance to do. For what it's worth, I've called t.web.client.getPage() at least 10 million times, and i don't have any complaints.
-- Moe Aboulkheir
My experience has been the same; I've used twisted.web.client for years now, in production applications, with no issues. That said, the original poster didn't mention any special requirements that forced him to go with mechanize; rather, the choice appears to have been made on the basis of activity. That said, there *is* a web2-based client, available from OSAF, named zanshin. I haven't used it, but it is most certainly being actively developed. L. Daniel Burr
participants (4)
-
Jonathan
-
L. Daniel Burr
-
Moe Aboulkheir
-
wang wei