You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lua Threading API (designed for CC:Tweaked/ComputerCraft)
This lightweight library designed for Minecraft mod called CC:Tweaked, and allows to run concurrent/pseudo asynchronous threads, using corouitines.
How to install it?
Just place `lib` folder anywhere, and include lib into your project using `require("/path/to/your/lib/folder/lib/thread")`.
Any other folder exept `thread` is not required, you can remove them.
Why?
This lib allows you to run many function simultaneously, but unlike parallel, threads can generate new threads and continue running.
Since computers in CC:T/ComputerCraft don't have cores, every thread you run, is running one-by-one, creating pseudo asynchronous tasks
Demo:
How to use:
localthread=require"lib.thread"
Warning!
This library requires to be started anywhere in your code. It is recomended to start master thread in start of your app/os, run your code as a thread.
thread.start()
TODO:
Join thread
Your idea
Conclusion
Feel free to open an issue, for bug, idea or something. Ask questions on discord: mrvoid__ or matrix chat: @mr-void:hackliberty.org