Fabric
Extends:
exposes a way to manage our underlying Threads
Constructor Summary
Public Constructor | ||
public |
Creates a new Fabric with the number of Threads equal to |
Member Summary
Public Members | ||
public get |
availableThreads: Array<Process>: * returns all Threads that are not currently working |
|
public get |
returns an Object that allows us to fetch <Process> by pids |
|
public get |
randomAvailableThread: Process: * returns the Process reference to a random available thread |
|
public get |
getter for all of our underlying thread <Process> |
Method Summary
Public Methods | ||
public |
invalidate(script: <type>) invalidates a script across all running Threads |
|
public |
Kills all threads in a Fabric |
|
public |
reserve(thread: *): * |
|
public |
Sends a job to a random available Thread for processing |
Inherited Summary
From class Expressive | ||
public static |
create(): * creates a new inherited instance |
|
public |
debug: * |
|
public |
expressive emit |
|
public |
when(): * expressive once |
Public Constructors
public constructor source
Creates a new Fabric with the number of Threads equal to require('os').cpus().length * 2
Override:
Expressive#constructorPublic Members
public get availableThreads: Array<Process>: * source
returns all Threads that are not currently working
public get randomAvailableThread: Process: * source
returns the Process reference to a random available thread
Return:
Process |
Public Methods
public invalidate(script: <type>) source
invalidates a script across all running Threads
Params:
Name | Type | Attribute | Description |
script | <type> | The script |