Skip to content
Simply, lightweight and easy multi-thread JavaScript library
JavaScript
Branch: master
Clone or download
deep-rain.com
deep-rain.com update readme
Latest commit e6ba324 Mar 6, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist update source map Mar 6, 2017
examples fix script src Mar 4, 2017
src fix semicolon Mar 6, 2017
.gitignore add .gitignore Mar 3, 2017
Gruntfile.js add Gruntfile Mar 3, 2017
LICENSE modify LICENSE Mar 3, 2017
README.md update readme Mar 6, 2017
package.json

README.md

thread.js

Simple, lightweight and easy multi-thread JavaScript library

Official WebSite

Usage

a simple.

var thread = new Thread(function(){
  return "hello Thread.js";
});

thread.once().done(function(d){
  console.log(d);    // -> hello Thread.js
});

with arguments.

var thread = new Thread(function(a, b){
  return a + b;
});

thread.once(1, 2).done(function(d){
  console.log(d);    // -> 3
});

with progress.

var thread = new Thread(function(){
  notify("progress");
  return "hello Thread.js";
});

thread.once().progress(function(d){
  console.log(d);    // -> progress
}).done(function(d){
  console.log(d);    // -> hello Thread.js
});

with other libraries.

var thread = new Thread(function(){
  example();
}, [
  "http://example.com/path/to/example.js",
  "http://example.com/path/to/example2.js"
]);

thread.once().progress(function(d){
  // ...
});

LICENSE

Apache-2.0

You can’t perform that action at this time.