[Stackless] added tasklet.throw

Richard Tew richard.m.tew at gmail.com
Sat Apr 6 21:32:54 CEST 2013


On Sat, Apr 6, 2013 at 10:29 PM, Kristján Valur Jónsson <
kristjan at ccpgames.com> wrote:

>      > I think I'm confused :-)
>
> So, I think it is cleaner to just disallow this, like s.run() and
> s.insert() already do.
>
Sounds fine to me.


> > def tasklet_bootstrap(f, *args, **kwargs):
> >   try:
> >       ret = f(*args, **kwargs)
> >   except:
> >       # handle
> > stackless.set_callable_wrapper(tasklet_bootstrap)
> This is currently indirectly possible, by setting stackless.tasklettype
> (IIRC) wehre you can put a tasklet subclass that overrides the __new__ etc.
> But the problem with both approaches is that an exception delivered
> before the tasklet has had the chance to run for the first time won't be
> handled by this.  Hence my suggestion to set a global handler.  Having a
> module level handler is fine, IMO.  Adding such a beast is also simple to
> do.  Perhaps I'll make the experiment.
>
>
Sounds fine to me, also.

Cheers,
Richard.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stackless.com/pipermail/stackless/attachments/20130407/fdd1ac66/attachment.html>


More information about the Stackless mailing list