u-async-ps
v0.1.7
Published
A 'micro' OO running process implemented in plain functions && objects for understanding processes, threads, etc.
Downloads
7
Readme
u-async-ps
A "micro" OO running process implemented in plain functions && objects for understanding processes, threads, etc.
Prerequisites
- NodeJs / NPM
Installation
cd /path/to/your/project
npm i --save 'u-async-ps'
Testing
From your application code.
const uAsyncPs = require('u-async-ps')
console.log('Successful uAsyncPs import? ', uAsyncPs)
Usage
This repo is under development. Initial LTS release will be 1.0.0, and it should not be used until then.
const uAsyncPs = require('u-async-ps')
const myPs = uAsyncPs(threadConfig)
myPs.spawnProcess(cycles)
Thread Configuration
Example
- For A0 to execute, the LAST instruction MUST have been C2 (testing "NEXT instruction prediction" for B2)
- For B1 to execute, the LAST instruction MUST have been C2
- For B2 to execute, the LAST instruction MUST have been A0
- All C Steps are unconditional, they fire on every step they are called
const threadConfig = [
{ name: 'A', instructions: [
{index: 0, conditions: ['last===C2', 'next===B2']}, {index: 1}, {index: 2}
]},
{ name: 'B', instructions: [
{index: 0}, {index: 1, conditions: ['last===C2']}, {index: 2, conditions: ['last===A0']}
]},
{ name: 'C', instructions: [
{index: 0}, {index: 1}, {index: 2}, {index: 3}
]}
]
Contributing
Not currently accepting outside contributors, but feel free to clone, modify and use as you wish.
Authors
License
This project is licensed under the DO_WHATEVER_YOU_WANT License - see the LICENSE file for details
Acknowledgments
- Marcus Phillips (Hack Reactor Co-Founder) --- Free Udacity "Object Oriented Js" Course