Constructor
new Node(given)
Parameters:
Name | Type | Description |
---|---|---|
given |
String | Following OTP convention, a node name, names should be 'given@host'. |
Properties:
Name | Type | Description |
---|---|---|
nodeIndexFromNodeName |
function | |
spawn |
function | |
host |
module:Serl.Node#host | Should mirror OTP convention, presumably refer to a hostfile. |
name |
module:Serl.Node#name | |
procMap |
Map | |
nodeMap |
Map | A map of connected nodes. |
cookie |
todo/unimplemented |
|
hidden |
todo/unimplemented |
Members
host :String
This custom type exists only in documentation, and must be manually enforced in code, by developers.
Type:
- String
Properties:
Name | Type | Description |
---|---|---|
module:Serl.Node#host |
name :String
Has the form given@host
, which is based on
the given-name of each call to Node(given)
. Analogous
to an OTP node name
This custom type exists only in documentation, and must be manually enforced in code, by developers.
Type:
- String
Properties:
Name | Type | Description |
---|---|---|
module:Serl.Node#name |
Methods
(static) nodeIndexFromNodeName(node, nodeName) → {integer}
Utility function, returning a nodeIndex
, integers used as
keys in module:Serl.Node#nodeMap.
Parameters:
Name | Type | Description |
---|---|---|
node |
module:Serl.Node | An instance of the Node class. |
nodeName |
module:Serl.Node#name |
Returns:
- Type
- integer
spawn()
Implements various arities of spawn/n.
Spawns an instance of Proc on some a certain
instance of Node. The keyword
this
in any fun
passed to spawn/n will refer
to the spawned proc
.
spawn/1
Spawns a Proc object on the parent node, which appliesfun
to an empty array []
. See
OTP docs.
Parameters:
Name | Type | Description |
---|---|---|
fun | Function | The function which will run in this process. |
spawn/2
(coming soon)spawn/3
Spawns a Proc object on the parent node, which applies a function (given and accessed via a module) to a list of arguments, in the manner of:module[funName]( ... funArgs )</code>
See OTP docs.
Parameters:
Name | Type | Description |
---|---|---|
module | Object | An object representing a code Module, with callable methods. |
funName | String | The string name of a method of module . |
funArgs | Array | An array of arguments to pass to module[funName] when the latter is called. |