[Stackless] timeout on channel receive

Richard Tew richard.m.tew at gmail.com
Tue Feb 20 22:34:37 CET 2007


On 2/20/07, Paul Sijben <sijben at eemvalley.com> wrote:
>  I am trying to move my time-sensitive communications stack away from
> threading.Thread and Queue.Queue and rather use stackless microthreads and
> channels.
>
>  I made some modules that will act as a mostly drop-in replacement. So far
> so good.
>
>  Until I got to the bit of my code that not just wants to get data out of a
> Queue (so now a channel) but timed as well.
>
>  Is there a way to set a timeout on a channel.receive()?

There is no standard way.

The way I would do it is to subclass channel to handle this
and to add some form of checking based on one of the available
versions of tasklet sleep functions.

If you want me to make up an example piece of code I am more
than happy to.

Richard.

_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless



More information about the Stackless mailing list