[Stackless] timeouts on channels

Richard Tew richard.m.tew at gmail.com
Fri Apr 13 12:19:38 CEST 2007


On 4/11/07, Alec Flett <alecf at flett.org> wrote:
> I've perused the list archives where folks have asked about timeouts in
> channels - seems like there's nothing built into stackless, that instead you
> need a watcher tasklet. I'm mainly trying  to emulate timeouts in
> stacklesssocket.py.
>
> A watcher thread won't be hard to implement, I just wanted to give my
> feedback that I think this is unfortunate that this isn't built into
> stackless.channel by default - because it seems like stackless could
> accomplish this in a much lighter weight fashion with just a simple
> parameter to receive() and/or send().
>
> Or is the problem that the scheduler doesn't visit channels unless someone
> initiates a connection on the other end? Hrm. Well anyway it would be nice
> if everyone didn't have to write their own timeout watchdog because there
> are certainly lots of pitfalls in getting that just right.

But is it is a given that everyone will be using Stackless in the same
way?  Take for example the 'normal' scheduling and the 'alternative'
scheduling as demonstrated by the following examples:

  http://stacklessexamples.googlecode.com/svn/trunk/examples/

Specifically these files:

  scheduleNormal.py
  scheduleAlternative.py

Given this uncertainty I am unsure whether it is feasible to build in
any higher level mechanisms like this in a way which will support
valid uses of the level of abstraction which Stackless currently
provides.

But I agree in general.  There is so much domain knowledge involved in
building up a framework based on Stackless that making things like
this available or more approachable can only be a good thing.

> Anyway, just my 2 cents. Hopefully I'll have timeout support in
> stacklesssocket.py reasonably soon. :)

All fixes which work towards making this module more compatible with
the built-in socket module would be greatly appreciated as patches
:-).

I imagine that it would have to modify ManageSockets which would take
care of it working when the module is monkey-patched in with 'normal'
scheduling.  As for 'alternative' scheduling, well, I think that
having these functions error if managerRunning is not set.

Cheers,
Richard.

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



More information about the Stackless mailing list