Re: [Twisted-Python] Limit on transport.write

2012-03-25 Thread Glyph
On Mar 26, 2012, at 2:21 AM, hz hanks wrote: > Hi, all > > I'm writing a program to transfer files over Internet. Sometimes the > files would be very big. Therefore, I'm not sure whether I could read > a large block of data and send them via one time > internet.protocol.transport.write(). On the

[Twisted-Python] Limit on transport.write

2012-03-25 Thread hz hanks
Hi, all I'm writing a program to transfer files over Internet. Sometimes the files would be very big. Therefore, I'm not sure whether I could read a large block of data and send them via one time internet.protocol.transport.write(). On the other hand, does the function internet.protocol.transport.

[Twisted-Python] Job offer match, respond to apply

2012-03-25 Thread glyph
I would like to take this time to welcome you to our hiring process and give you a brief synopsis of the position's benefits and requirements. If you are taking a career break, are on a maternity leave, recently retired or simply looking for some part-time job, this position is for you. Occupat

Re: [Twisted-Python] Did anyone use pprocess before?

2012-03-25 Thread Glyph
On Mar 25, 2012, at 9:59 PM, Peng Xiao -X (penxiao - Digital China at Cisco) wrote: > Hi experts, > I have a question about pprocess module. The pprocess module has nothing to do with Twisted, and is therefore off-topic for this list. You should get in touch with its creator, Paul Boddie. Se

[Twisted-Python] the good, the log, and the ugly

2012-03-25 Thread Glyph
Right now, we have a pretty bad logging idiom. All over Twisted, you'll find stuff like this: log.msg("twistd %s (%s %s) starting up." % (copyright.version, sys.executable, runtime.shortPythonVersion())) ...

[Twisted-Python] Did anyone use pprocess before?

2012-03-25 Thread Peng Xiao -X (penxiao - Digital China at Cisco)
Hi experts, I have a question about pprocess module. When I use: time1 = time.time() results = pprocess.pmap(calculate, sequence, limit=limit) time2= time.time() # Show the results. for result in results[i*N:i*N+N]: pass time3 = time.time() I found time2 - time1 = 0.8 seconds, but

Re: [Twisted-Python] How to use multi-core CPU in Twisted

2012-03-25 Thread Glyph
On Mar 25, 2012, at 9:24 PM, Peng Xiao -X (penxiao - Digital China at Cisco) wrote: > Hi experts > > I want to use multi-core of CPU in twisted for parallel programming. > Could anyone tell me how to archive that? > Very thanks. > > Best > Regards, > > Xiao Peng There are many different w

Re: [Twisted-Python] Mimicking a blocking API using Twisted

2012-03-25 Thread Glyph
On Mar 25, 2012, at 9:27 PM, Paul Reznicek wrote: > I have similar needs and did not found usable answers, so I wrote some > q&d hacks for doctests and also for UI interactions, where the user should > be blocked until something in non-blocking deferred finish or "time-outed". These hacks are al

[Twisted-Python] How to use multi-core CPU in Twisted

2012-03-25 Thread Peng Xiao -X (penxiao - Digital China at Cisco)
Hi experts I want to use multi-core of CPU in twisted for parallel programming. Could anyone tell me how to archive that? Very thanks. Best Regards, Xiao Peng ___ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twist

Re: [Twisted-Python] Mimicking a blocking API using Twisted

2012-03-25 Thread Paul Reznicek
Hello, I have similar needs and did not found usable answers, so I wrote some q&d hacks for doctests and also for UI interactions, where the user should be blocked until something in non-blocking deferred finish or "time-outed". Below hacks are working with twisted 10.0.0, no idea about more actua

Re: [Twisted-Python] Mimicking a blocking API using Twisted

2012-03-25 Thread Glyph
On Mar 25, 2012, at 8:03 PM, Itamar Turner-Trauring wrote: > On 03/25/2012 07:54 PM, Laurens Van Houtven wrote: >> The thing I'm documenting is a server, I'm documenting it by interacting >> with it as a client. I realize that doesn't entirely detract from your point >> -- you might still be in

Re: [Twisted-Python] Mimicking a blocking API using Twisted

2012-03-25 Thread Itamar Turner-Trauring
On 03/25/2012 07:54 PM, Laurens Van Houtven wrote: > The thing I'm documenting is a server, I'm documenting it by interacting with > it as a client. I realize that doesn't entirely detract from your point -- > you might still be introducing problems that would not affect a "real" client. > > My i

Re: [Twisted-Python] Mimicking a blocking API using Twisted

2012-03-25 Thread Laurens Van Houtven
The thing I'm documenting is a server, I'm documenting it by interacting with it as a client. I realize that doesn't entirely detract from your point -- you might still be introducing problems that would not affect a "real" client. My intention is to write BDD-ish stuff (except not with the usua

Re: [Twisted-Python] Mimicking a blocking API using Twisted

2012-03-25 Thread Itamar Turner-Trauring
On 03/25/2012 05:02 PM, Laurens Van Houtven wrote: > Hi, > > > I'm trying to find out if there's a reasonable way to mimic a blocking > API with an existing non-blocking API. I want to do this so I can > write doctests. > > For example, I want to make a remote AMP call. It returns a deferred. >

[Twisted-Python] Mimicking a blocking API using Twisted

2012-03-25 Thread Laurens Van Houtven
Hi, I'm trying to find out if there's a reasonable way to mimic a blocking API with an existing non-blocking API. I want to do this so I can write doctests. For example, I want to make a remote AMP call. It returns a deferred. Instead of returning a deferred, I want it to block until the deferre