[Stackless] stacklesslib.util.cancellable

Kristján Valur Jónsson kristjan at ccpgames.com
Wed Sep 25 10:48:27 CEST 2013


I've been adding small things and goodies to stacklesslib for the past few quarters:
http://bitbucket.org/krisvale/stacklesslib

The latest addition is util.cancellable, which is a context manager that can be used  to create a cancellable context for a tasklet.
A tasklet can then call handle.cancel() which will raise a CancelledError out of the context manager.
This is in principle similar to how util.timeout works, also a context manager that adds a timeout to a tasklet's context.

I've renamed call_async to tasklet_call(), which better explains its purpose.  It is now basically a shorter (and simpler) form of
stacklesslib.futures.tasklet_executor.submit(...).get_result()


K
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stackless.com/pipermail/stackless/attachments/20130925/258fcfe4/attachment.html>


More information about the Stackless mailing list