Constructor
new Crystal(file, countopt)
- Source:
Properties:
Name | Type | Description |
---|---|---|
clusters |
Collection | Collection of clusters |
Creates a new Crystal instance
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
file |
String | Relative or absolute path to file to run |
|
count |
Number |
<optional> |
Number of clusters to create, defaults to number of CPU cores |
Methods
broadcast(message)
- Source:
Broadcast a message to all clusters
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
message |
Object | Message to send Properties
|
createCluster(id)
- Source:
Spawns a cluster
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | Cluster ID |
createClusters()
- Source:
Spawns new clusters
getCluster(pid)
- Source:
Fetches a cluster
Parameters:
Name | Type | Description |
---|---|---|
pid |
Number | Process ID to find |
restart(messageopt)
- Source:
Restarts all clusters, or a specific one
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
message |
Object |
<optional> |
The message sent Properties
|