lua-users home
lua-l archive

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


I believe the purpose of that is to have the print"done" after the
do-end block, such that the nursery must have been closed before "done"
is printed. Otherwise "done" would be printed before the nursery is
closed, right after "waiting for child tasks".

On 20.09.22 19:43, bil til wrote:
One very basic question, I hope not TOO basic.

Why do you use this do...end block inside this async_main function?

As I see it,  this do...end practically IS the complete function code
of async_main (except the print at the end, but this does not use any
variables).

So for THIS basic example, the do...end is not important, is this correct?

You use it only for the next steps, where you would like to add
further more complicated coding into this async_main function and you
want to "protect" the local variables?

Am Fr., 9. Sept. 2022 um 16:58 Uhr schrieb John Belmonte <john@neggie.net>:
I'm sharing a draft article "Structured concurrency and Lua (part 1)".

   https://gist.github.com/belm0/4c6d11f47ccd31a231cde04616d6bb22