Re: [Twisted-Python] using perspective broker to talk to a subprocess?

2009-10-06 Thread Ryan Burns
wow, ampoule looks like just what I need, and I think it will work fine as-is. Thanks for the help, Ryan On Oct 6, 2009, at 8:56 PM, Glyph Lefkowitz wrote: On Tue, Oct 6, 2009 at 11:18 PM, Ryan Burns wrote: Disregarding reasons of why I would want to do this, is this something that is po

Re: [Twisted-Python] Lots and lots and lots and lots... of deferreds

2009-10-06 Thread Steve Steiner (listsin)
On Oct 6, 2009, at 11:25 PM, Andrew Bennetts wrote: > Steve Steiner (listsin) wrote: > [...] >> I expect the usual flurry of "you must post your exact code or we >> can't help you at all, moron" posts, but... > > I'll try to restrain myself ;) Thanks, I appreciate your restraint. Must say

Re: [Twisted-Python] Example of a long-polling asynchronous web servic?

2009-10-06 Thread Stephen Mattison
Hey Glyph thanks for responding so promptly! First if I understand correctly on the server-side we have some code like: def get_data_updates(): if (!has_updates): return NO_DATA return json.encode(the_updates) and on the client side def poll_for_updates(): while True: respon

Re: [Twisted-Python] using perspective broker to talk to a subprocess?

2009-10-06 Thread Glyph Lefkowitz
On Tue, Oct 6, 2009 at 11:18 PM, Ryan Burns wrote: > Disregarding reasons of why I would want to do this, is this something > that is possible? Absolutely. Here's an example that uses AMP rather than PB: https://launchpad.net/ampoule If AMP is OK, you can just use Ampoule as-is; if not,

Re: [Twisted-Python] Example of a long-polling asynchronous web servic?

2009-10-06 Thread Glyph Lefkowitz
On Tue, Oct 6, 2009 at 11:30 PM, Stephen Mattison wrote: > How can I implement this in Twisted? > You can use DeferredResource: http://twistedmatrix.com/documents/8.2.0/api/twisted.web.util.DeferredResource.html or you can return NOT_DONE_YET from Resource.render(), and hold on to the reques

Re: [Twisted-Python] Lots and lots and lots and lots... of deferreds

2009-10-06 Thread Steve Steiner (listsin)
On Oct 6, 2009, at 10:57 PM, Glyph Lefkowitz wrote: However, you can experiment with it pretty easily using DeferredSemaphore: http://twistedmatrix.com/documents/8.2.0/api/twisted.internet.defer.DeferredSemaphore.html Cool, I didn't know about that, I'll give it a look. Thanks! If your app

[Twisted-Python] Example of a long-polling asynchronous web servic?

2009-10-06 Thread Stephen Mattison
Hey guys I'm trying to implement some web-services over JSON-RPC, and one of the methods needs to use server-push. I will try and explain my problem as well as I can. I have a client, which is an iPhone, natively running a JSON-RPC( or XML-RPC ) client implementation. I need to do something like

Re: [Twisted-Python] Lots and lots and lots and lots... of deferreds

2009-10-06 Thread Andrew Bennetts
Steve Steiner (listsin) wrote: [...] > I expect the usual flurry of "you must post your exact code or we > can't help you at all, moron" posts, but... I'll try to restrain myself ;) > In spite of my not having posted specific code, could someone with > some actual experience in t

Re: [Twisted-Python] Lots and lots and lots and lots... of deferreds

2009-10-06 Thread Matt Perry
If everything is happening in a single thread, you probably don't need to lock anything, because there's no shared access and therefore no race conditions. I have no idea how your app is written, so you may need them - I don't know. Just an observation. - Matt On Tue, Oct 6, 2009 at 11:13 PM,

[Twisted-Python] using perspective broker to talk to a subprocess?

2009-10-06 Thread Ryan Burns
Hi All, I'm writing a twisted application where I'd like to run and communicate with subprocesses that also happen to be twisted apps. I'm wondering if I can somehow combine twisted's process and perspective broker code so that I can launch a twisted server in a subprocess and communicate

Re: [Twisted-Python] Lots and lots and lots and lots... of deferreds

2009-10-06 Thread Steve Steiner (listsin)
On Oct 6, 2009, at 11:00 PM, Matt Perry wrote: > One thing of note is that you say you have concurrency issues > handled -- but with asynchronous I/O, there are no concurrency > issues, since there's no concurrency (at least, not at application > level). This is confusing at first but it's

Re: [Twisted-Python] Lots and lots and lots and lots... of deferreds

2009-10-06 Thread Matt Perry
Your limit will usually be the number of file descriptors in the system, which can be usually changed via ulimit or your system's equivalent. On Linux I believe it defaults to 1024, so you should be able to handle 1024 simultaneous connections. One thing of note is that you say you have concurren

Re: [Twisted-Python] Lots and lots and lots and lots... of deferreds

2009-10-06 Thread Glyph Lefkowitz
On Tue, Oct 6, 2009 at 10:40 PM, Steve Steiner (listsin) < list...@integrateddevcorp.com> wrote: >Should I limit the number of "in-flight" pages? > I'm not going to comment on that, because I don't know what your app is doing or why it appears to be dying. As you said, you didn't post c

[Twisted-Python] Lots and lots and lots and lots... of deferreds

2009-10-06 Thread Steve Steiner (listsin)
So, I have a situation... I have an application whose basic function is, in simplified form: def main(): get_web_page(main_page_from_params) def get_web_page(page_name): set up a page getter deferred, one of the call

Re: [Twisted-Python] Problem with XMLRPC resource wrapped with guard basic auth

2009-10-06 Thread exarkun
On 12:00 am, as...@impactdamage.com wrote: >Using the current trunk r27366 (which is after #4014 fixed a related >issue), I am having trouble with an implementation of web.guard wrapped >XMLRPC. This is a new test implementation to expose both a soap and >xmlrpc >interface. SOAP works, but xmlrp

[Twisted-Python] Problem with XMLRPC resource wrapped with guard basic auth

2009-10-06 Thread asset
Using the current trunk r27366 (which is after #4014 fixed a related issue), I am having trouble with an implementation of web.guard wrapped XMLRPC. This is a new test implementation to expose both a soap and xmlrpc interface. SOAP works, but xmlrpc throws UnsupportedMethod POST. Here is my

Re: [Twisted-Python] Structural issues in Lore XHTML documents

2009-10-06 Thread Kevin Horn
On Mon, Oct 5, 2009 at 1:44 PM, Kevin Horn wrote: > > FYI: I've hacked together a simple "lorelint" script to automatically check > for these type of issues. Happy to share if anyone thinks it might be > useful for future release mgmt automation or whatever. > For benefit of future readers...Lo

[Twisted-Python] inlineCallbacks

2009-10-06 Thread Pet
Hi, calling in client code self.cred.login() I can't print login result. What I'm doing wrong? login method returns deffered, but should yield result from callRemote method. Thanks for any help! Pet class Cred: @inlineCallbacks def login(self): proxy = Proxy(LOGIN_PROXY)

Re: [Twisted-Python] Is it necessary to utilize twisted.cred in twisted web?

2009-10-06 Thread biziap biziap
Dear phil > true, depending on your needs, this may be all that you need. from > your description, though, it sounds like you'd be doing this > authentication step in every resource you want to protect, which could > become tedious (aka error-prone) in a big project. I do have lots of resources to