[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Is there a way to pause lua_pcall() and resume later?
- From: v <v19930312@...>
- Date: Mon, 12 Aug 2019 17:22:15 +0300
On Mon, 2019-08-12 at 16:18 +0200, Viacheslav Usov wrote:
> On Mon, Aug 12, 2019 at 3:45 PM Andreas Falkenhahn <
> andreas@falkenhahn.com> wrote:
>
> > To clarify, what I mean by "pause" is that lua_pcall() must return
> so that control is back on the UI thread. Later, once I have received
> the event that the message box has been closed, I want to "resume"
> the previous call to lua_pcall().
>
> Then just make it return. And then call it again. Do not block while
> in the call.
Or use Lua coroutines to make code easier to read. They really can save
the day when it comes to asynchronous code.
Together with `coroutine.wrap` it will require little to no effort on C
side.
--
v <v19930312@gmail.com>