Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > A Solution using Tasks Re: [Stackless] Suggestion for a Solution ?

Reply
Thread Tools

A Solution using Tasks Re: [Stackless] Suggestion for a Solution ?

 
 
Andrew Francis
Guest
Posts: n/a
 
      06-28-2006
Hello Patrick:

--- "Patrick M. Nielsen" <(E-Mail Removed)> wrote:

> I had a similar problem, and Radix's threadless
> Twisted snippet proved to be
> a very viable solution
>
> Have a look at:
>
>http://twistedmatrix.com/trac/browse...s.py?rev=17407


Thanks for the advice. Bob Ippolito also suggested
this. However I have been experimenting with the
Twisted task class.

I am still testing but I have done the following with
success.

1. Set up a function -

def pump():
stackless.schedule()

2. l = task.LoopingCall(pump)
l.start(some_time_period)
reactor.listenTCP(port, MyHttpFactory())
reactor.run()

While Twisted waits for a connection, the call to
pump() allows other tasklets that are waiting, a
chance to run.

Once I know all the ins-and-outs, I will write this up
in the Wiki including an example.

Thanks for everyone's help.

Cheers,
Andrew


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using multicore CPUs in parallel tasks Marc Hoeppner Ruby 18 11-03-2009 07:48 PM
How to cancel one of the scheduled tasks in j2me using Timer snehapshinde@gmail.com Java 0 11-05-2008 10:27 AM
Using Web Services to create Scheduled Tasks PhilV ASP .Net Web Services 2 11-05-2007 02:50 PM
VoIP Appliance Solution: suggestion giovanni.costagliola@gmail.com VOIP 6 10-02-2006 02:27 PM
Using Ruby to automate Windows tasks Vincent Foley Ruby 2 01-13-2006 06:09 PM



Advertisments