New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ember-multithread

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-multithread

The default blueprint for ember-cli addons.

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

ember-multithread (Still WIP)

Dead-simple multi-threading support for Ember.js applications.

Installation

ember-multithread is an Ember-CLI addon. You can install it via:

ember install ember-multithread

Usage

Basic usage of WorkerProperty

You can create WorkerProperty in your controllers, routes or components.

import Ember from 'ember';
import {worker} from 'ember-multithread';

export default Ember.Controller.extend({
  calculatePi: worker(function(iteration) {
    let pi = 0;
    let n = 1;
    for (let i = 0; i <= iteration; i++) {
      pi = pi + (4 / n) - (4 / (n + 2));
      n = n + 4;
    }
    return pi;
  }),
  actions: {
    calculate() {
      this.get('calculatePi').perform(500000000).then(result=> {
        console.log(result);
      });
    }
  }
});

Set properties in your Ember app

This may cause race conditions if there are multiple works running simultaneously in one controller.

TODO

Synergy with ember-concurrency

TODO

Multi-threaded map() and reduce()

TODO

Restriction

TODO

Special Thanks

Thanks ember-concurrency and parallel.js for the inspiration.

Keywords

ember-addon

FAQs

Package last updated on 19 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts