# ember-multithread

> The default blueprint for ember-cli addons.

Latest version **0.0.1** (published 2016-08-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install ember-multithread
pnpm add ember-multithread
yarn add ember-multithread
bun add ember-multithread
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2016-08-19 |
| First published | 2016-08-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Zhongliang 'C.Rivers' Wang |
| Maintainers | cryrivers |
| Keywords | ember-addon |

## Links

- npm: https://www.npmjs.com/package/ember-multithread
- Repository: https://github.com/Cryrivers/ember-multithread
- Homepage: https://github.com/Cryrivers/ember-multithread#readme
- Issues: https://github.com/Cryrivers/ember-multithread/issues
- npm.io page: https://npm.io/package/ember-multithread

## Dependencies (1)

- [ember-cli-babel](https://npm.io/package/ember-cli-babel.md) ^5.1.6

## Recent versions

- 0.0.1 (latest) — 2016-08-19
- 0.0.0 — 2016-08-18

## README

# 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:

```bash
ember install ember-multithread
```

## Usage
### Basic usage of `WorkerProperty`
You can create `WorkerProperty` in your controllers, routes or components.

```js
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.

---
_Source: https://npm.io/package/ember-multithread · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
