GithubHelp home page GithubHelp logo

defold-luaproc's Introduction

Native extension for luaproc

Original library here: https://github.com/askyrme/luaproc

The goal of this is to provide simple cross platform multi-process capability for defold.

Use cases could include:

  • Multiple processes on a server (thats what Im using it for)
  • Multiple processes for a game - maybe offloading agent or modelling compute to another proc
  • Client data streaming - openining multiple input channels to handle different data streams at once.

The example provides a couple of ways this can be used.

Important Notes

The Lua context that a new process uses is not a Defold context. Which means there are none of the Defold extensions available. This may be expanded in the future. For the moment it is recommended that these processes are used for computational or io.

The example current shows two use cases.

The first use case needs "curl" to be available on your system.

  1. Pressing the "1" key three csv files will be downloaded at the same time. The time taken will be reported in the log. Pressing the "2" key will execute downloading the same three files sequentially. Importantly, the sequential download does not move the data anywhere so it is quite fast anyway. The luaproc example sends all the data over a channel to potentially be used in another process.

  2. Pressing the "3" key shows the loading and rendering of 4 txt files at the same time into the gui hud. This does not really make a great real life use case, since all the data needs to be merged and then rendered to the gui. However, it does show how to use multiple io. The test also only reads 80 characters at a time (to show the data more easily). Larger chunks are much faster (recommend 64K chunks if possible).

A third example will be added soon to show more computationally intensive examples where each process executes a mandelbrot frame which are then shown in sequence for an animation.

defold-luaproc's People

Contributors

dlannan avatar

Stargazers

Alexey Gulev 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.