lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I haven't looked closely at using this stuff, but it seems like any long process that will eventually return a result could be handled nicely this way.  A Lua thread that reads from the network, performs a long calculation, launches an asynchronous process to compute a result, etc.


-----Original Message-----
From: Roberto Ierusalimschy [mailto:roberto@inf.puc-rio.br]
Sent: Thursday, November 21, 2002 8:35 AM
To: Multiple recipients of list
Subject: Re: incompatibilities to 5.0 beta 


> But: is there any way to tell if a coroutine returned returned due to a
> yield, or due to a "return"? (I mean a generalized way, that doesn't depend
> on the function "return"ing a special value.)

No. (Although you can find out the next time you try to resume it.)
Maybe we will add something like "coroutine.status" that tells whether
a coroutine is still active, but we are still waiting for "realistic
examples".

-- Roberto