[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: python's twisted deferred : how to in Lua?
- From: Valerio Schiavoni <valerio.schiavoni@...>
- Date: Fri, 26 Mar 2010 20:57:30 +0100
Hello Francisco,
this link mechanism sounds very much like the one I was thinking of.
How is it implemented internally ?
On Fri, Mar 26, 2010 at 6:10 PM, Francisco Sant'anna
<francisco.santanna@gmail.com> wrote:
> Hello,
> You might also look at LuaGravity.
> This mechanism looks like a `link` between two Lua functions:
>
> function a ()
> return 1
> end
> function b (v)
> return v * 2
> end
> function c (v)
> print(v)
> end
> link(a, b)
> link(b, c)
> a()
>
> By executing `a`, when it returns 1, `b` is triggered receiving that value.
> Then `b` returns 1*2 and `c` is called, printing 3.
>
> --
> Francisco Sant'Anna
> http://www.lua.inf.puc-rio.br/luagravity/
>
> On Mon, Mar 22, 2010 at 5:06 PM, Valerio Schiavoni
> <valerio.schiavoni@gmail.com> wrote:
>>
>> Hello,
>> the twisted python framework provides a very elegant mechanism to do
>> asynchronous programming, through so called 'deferred'.
>> See doc here:
>> http://twistedmatrix.com/documents/current/core/howto/defer.html
>>
>> I was wondering if there's support for this programming style in the
>> language itself (looking at the doc I don't think so), or if
>> something similar is provided by Lua frameworks.
>>
>> thanks,
>> valerio
>
>
>
>