Namespace: 'Node#procMap'

Serl.'Node#procMap'

A map of a node's local processes (any instances of Proc which were created by calling spawn/n on that node. Here we use a Map, because we anticipate frequent lookups based on given Pids. We also expect 'frequent additions and removals of key-value pairs'

Properties:
Name Type Description
@keys module:Serl.Pid

Keys in the Map should be instances of this class.

@values module:Serl.Proc

Values in the Map should be instances of this class.

counter module:Serl.ProcIndex

module:Serl.'Node#procMap'.counter

Source:
To Do:
  • update docs to remind developers to enforce nodeIndex = parseInt(nodeIndex).
  • Should ProcMap have its own class?

Members

(static) this.procMap.counter

This helps us avoid duplicate process-indices on the local node, when generating a Pid object. We want to use Map here, because we expect 'frequent additions and removals of key-value pairs'

Each node must track all its previously spawned processes, and so we want an incrementing Node.procMap.counter, to ensure that for the lifetime of a node, N, all of N's local processes have a unique ProcIndex.

In the current implementation, the upper limit seems to simply be the size of Node.procMap.counter. (In Erlang, the equivalent number is stored in 18 to 28 bits, after which numbers are reused... however in JavaScript, it seems we have almost 53 bits...)

Properties:
Name Type Description
module:Serl.'Node#procMap'.counter
Source: