luv icon indicating copy to clipboard operation
luv copied to clipboard

Fix async arguments

Open javalikescript opened this issue 1 year ago • 1 comments

Protect async send() arguments using a mutex. Use copy for async arguments rather than Lua reference. Clear arguments in callback and before sending rather than after. Keep existing and possibly weird behavior. Allow async to use a FIFO queue.

Fixes #505

javalikescript avatar Nov 17 '24 14:11 javalikescript

I added the FIFO queue because it was mentioned in the issue #505 and made it optional for the sake of compatibility. I also wanted to keep the libuv behavior, to coalesce calls, when there is no queue nor data.

The issue is quite clear but the fix in this PR is aguable so do not hesitate if you think about any other option.

I could remove the queue from this PR, as this is a pure luv feature which will have to be supported in the long run!

Thank you for your help

javalikescript avatar Jan 25 '25 08:01 javalikescript