lua-users home
lua-l archive

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


On 23 November 2016 at 02:16, Russell Haley <russ.haley@gmail.com> wrote:
>> On Tue, Nov 22, 2016 at 4:59 PM, Dibyendu Majumdar
>>> This is just something I have been wondering about. I personally have
>>> not yet found a use case for Lua's coroutines - the main reason being
>>> that the resume has to be explicit. What would be more useful is if
>>> the coroutine semantics could be harnessed to create an async/await
>>> type solution as in C#. That is, can a solution be found to
>>> automatically resume the coroutine when an event associated with a
>>> 'yield' completes. As Lua is single threaded so the solution needs to
>>> resume the coroutine within the same OS thread.
>>>
>> Something like this?
>> http://25thandclement.com/~william/projects/cqueues.html
>>
>> Very slick stuff. Also see
>>
>> https://github.com/daurnimator/lua-http
>>
>> and my shameless plug:
>>
>> https://github.com/RussellHaley/lua-http-endpoints
>>
> Sorry, missed a good link. https://github.com/wahern/cqueues/wiki
> Daurnimators got some really nice cqueue enabled libraries I'm looking
> forward to using (See the "Libraries that use cqueues" page).
>

Thank you!