AllEx JS Runtime
This module brings the crucial program, the
This is the AllexJS Machine Manager. It does exactly what its name says - manages all the processes on your machine.
However, the mechanics for that management job is divided into several layers.
Reading the conf
The configuraton file is written in JSON format in the
allexmaster is started in a particular directory, it looks for
allexmasterconfig.json in that directory. If such a file is not found, a default configuration is created.
This is the address where
allexmaster will be looking for for the Lan Manager
allexlanmanager, on the default port 23552, on the default protocol 'ws' (WebSockets). Support for different ports/protocols is about to come
allexmaster will be spawning new processes for various Services. Each new process will be told to start listening on
- ws protocols, and for each protocol a different port will be declared.
For each of the three protocols,
allexmaster maintains a list of open ports (via allex_portofficeserverruntimelib), so that each new process will be declared the first free port for the protocol - starting from a number defined in
Unix socket protocol
Unix sockets (or pipes) are sockets that work only within a single machine. In order for all spawned child processes to be capable of talking to
allexmaster, and vice versa, Unix socket servers will be opened like this:
/tmp/allexmachinemanagerfor U#ix based machines, or
\\\\x\\pipe\allexmachinemanageron Windows based machines (taken care of by allex_temppipedirserverruntimelib)
- a child process with pid, for example, 355 will be listening on
Because the "port" for Unix sockets is controlled by the OS kernel (that assigns process pids), there is no starting port number in
Satisfying the needs of LanManager
- connects to
allexlanmanageron the declared address, on the predefined port with the predefined
- reads the list of unsatisfied needs (list of Services that should be instantiated)
- for each unsatisfied need spawns a new child process with ports assigned to protocols
- notifies the
allexlanmanagerabout the new process
allexlanmanagerto check the declared ports if it can reach them
allexlanamangerapproves the listening ports, it will delete the satisfied need from a list of needs and put up a new record in the list of running Services so that the whole cloud can use it
Reporting "Service down" events
allexmaster is directly connected to its child process (in a Parent-Child relationship), it is the first to know if the program stopped working. At that moment it notifies
allexlanmanager about this event.
allexlanmanager will remove the corresponding record from the list of running Services and recreate the appropriate Service need record in the list of Services that should start.