Coder Social home page Coder Social logo

treading-cc's Introduction

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:

Demo

How to use:

local thread = 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

This library under GPL-3.0 licence.

treading-cc's People

Contributors

mr-v01d avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.