[Stackless] Retrieving the Return Value of a Stackless Python Tasklet Bound Function?

Andrew Tutt tutt.andrew at gmail.com
Wed Jun 23 09:13:04 CEST 2010


>
> The simplest way to do this would be to define the wrapping Python

function code in C as a string, and to compile it into a function

object that you can run as a tasklet.  An example Python function

follows, the C part I leave to you.


> e.g.


>  def RunFunctionAndGetResult(chan, func, *args, **kwargs):

     chan.send(func(*args, **kwargs))


That was precisely the suggestion I would have made, but I was not sure it
would be right. Gives me a bit more confidence when it comes to answering
future questions!

On Tue, Jun 22, 2010 at 11:16 PM, Richard Tew <richard.m.tew at gmail.com>wrote:

> On Tue, Jun 22, 2010 at 11:37 PM, Lin Luo <luolin at ccpgames.com> wrote:
> > the caller. But I have yet to see a way to retrieve the return value of
> the
> > bound callable running as a tasklet.
>
> I do not know that there is one.
>
> > important return value to be used later. It seems that writing such a
> > Micromanaging function on the C side is not very feasible, since I
> haven't
>
> The simplest way to do this would be to define the wrapping Python
> function code in C as a string, and to compile it into a function
> object that you can run as a tasklet.  An example Python function
> follows, the C part I leave to you.
>
> e.g.
>
>  def RunFunctionAndGetResult(chan, func, *args, **kwargs):
>      chan.send(func(*args, **kwargs))
>
> Cheers,
> Richard.
>
> _______________________________________________
> Stackless mailing list
> Stackless at stackless.com
> http://www.stackless.com/mailman/listinfo/stackless
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stackless.com/pipermail/stackless/attachments/20100623/fecafbf7/attachment-0001.htm>


More information about the Stackless mailing list