Re: [Twisted-Python] Daemon processes on windows

2009-11-08 Thread Brian Granger
Bummer, then I can't use this approach. My "server" uses reactor.spawnProcess > which needs the signal handlers to be installed (SIGCHLD specifically) to > work > properly... do you know if it can be done without the dual thread trick. > > > ...On windows? I don't think Windows has SIGCHLD. > > Y

Re: [Twisted-Python] Daemon processes on windows

2009-11-08 Thread Brian Granger
David, While this process is certainly doable, I'll also point out that on > Windows, the more "natural" approach to this is to implement the > process as a service. That also buys you some regular Windows > approaches to management (net stop/start from command line, services > UI from the contr

Re: [Twisted-Python] Daemon processes on windows

2009-11-08 Thread Brian Granger
Sure, you can find a slightly updated version of the code in the attachment, licensed under the two clause BSD license and without the syntax error. Thank you very much for being willing to share this code under the BSD license. I will try this out and see if it does the job for us. > It would

Re: [Twisted-Python] Daemon processes on windows

2009-11-07 Thread Brian Granger
Fantastic, thanks for sharing this code. I will definitely have a look. If it turns out to work for us, would you mind releasing this under a BSD license so we can include it in IPython (BSD open source project)? In either case, the ideas will be very helpful to us. Cheers, Brian It is possib

[Twisted-Python] Daemon processes on windows

2009-11-07 Thread Brian Granger
Hi, I have a server-like process that uses twisted. I need it to daemonize itself and on linux/os x I am simply using the daemonize function from twistd. This works fine. What about Windows thoughI saw that the win32 version of twistd doesn't have (unless I am missing it) the ability to dae

Re: [Twisted-Python] sleeping in inlineCallbacks

2009-10-29 Thread Brian Granger
> Hi Brian > > Forgive me for butting in, but why :-) > > Helpful butting in is more than fine.. > Importing the reactor is no big deal, and if you use task.deferLater, apart > from not having to write any code you also have the advantage of being able > to pass it a result that the deferred

Re: [Twisted-Python] sleeping in inlineCallbacks

2009-10-29 Thread Brian Granger
Glyph, In general, please reply on this list inline, with quoting and trimming, > like so: > > http://en.wikipedia.org/wiki/Posting_style#Inline_replying > > This might seem like a minor thing, but it really helps those of us who > have to follow long discussions and many mailing lists. > So

Re: [Twisted-Python] sleeping in inlineCallbacks

2009-10-28 Thread Brian Granger
I have been using Twisted for years but only recently began to use inlineCallbacks (couldn't give up Python 2.4 support until recently). This simple asynch. sleep function is fantastic. Just today I used to it with inlineCallbacks to dramatically clean up some complex deferred logic. Thanks, Bri

Re: [Twisted-Python] Disturbing aspect of zope.interface

2009-10-08 Thread Brian Granger
> On Thu, Oct 8, 2009 at 7:23 PM, Brian Granger wrote: > >> I know this is not the zope list >> > > You're right, it's not. Perhaps you could send a message to the interface > package development list? > > https://mail.zope.org/mailman/listinfo/inter

[Twisted-Python] Disturbing aspect of zope.interface

2009-10-08 Thread Brian Granger
Hi, I know this is not the zope list, but I am encountering this in a twisted project, so I wanted to get some ideas here first. I am finding that zope.interface is like an infectious disease. Here is a simple example: In [35]: import zope.interface as zi In [37]: class A(object): :

Re: [Twisted-Python] Twisted slow in Mac OS X fast on Windows

2009-02-20 Thread Brian Granger
): ...: a = 1 + i In [2]: %timeit f() 100 loops, best of 3: 8.33 ms per loop That's depressing... Cheers, Brian On Fri, Feb 20, 2009 at 11:19 AM, Jean-Paul Calderone wrote: > On Fri, 20 Feb 2009 11:11:24 -0800, Brian Granger > wrote: >> >> Hi, >> >> We use

[Twisted-Python] Twisted slow in Mac OS X fast on Windows

2009-02-20 Thread Brian Granger
Hi, We use Twisted extensively in the IPython project for parallel and distributed computing. We have an extensive test suite that uses trial to test our servers and clients. Everything works great...but...the test suite takes much longer to run on OS X than windows. Here is what I mean: 1. 2

[Twisted-Python] Re: Problems with signalProcess on Windows

2009-02-06 Thread Brian Granger
OK, it looks like I solved this. My external program is a python program. I was starting it without the "-u" flag to Python, which turns on unbuffered output. Adding the "-u" flag made the error go away. I found this tip in the docstrings of the _dumbwin32proc.py Twisted module. Whoever put th

[Twisted-Python] Problems with signalProcess on Windows

2009-02-06 Thread Brian Granger
Hi, [take a deep breath and try to get over how much I dislike Windows] So, I am using Twisted's external process capabilities in a cross-platform setting. Almost everything is working now in Windows. But, when I try to stop the external program (using signalProcess("INT")) that I starting using