luvit-api-design
luvit-api-design copied to clipboard
`thread` module design
Just spitballing some ideas.
- Provide a shortcut reference to
uv.new_async
(thread.new_async
? Would have to decide on naming style), sinceasync
really only has use in the context of multiple threads (correct me if it doesn't). - Remove
join
,equals
andqueue
, since those already exist as member methods. - Have
work
take only a singlethread_entry
argument and haveWorker:queue()
yield the current coroutine (something along the lines of this). This is probably the biggest one I'd personally like to see. - Automatically attempt to serialize/deserialize tables into json, only throwing an error if that fails instead of every time a table is passed. Probably the iffiest suggestion here (user might expect tables to be equal, etc), but it could be useful occasionally.
- Automatically attempt to serialize/deserialize functions into bytecode instead of throwing an error if a function is passed. Iffy for the same reasons as mentioned above.