The SAYMON architecture allows users to develop server extensions that add the functionality, they need, to SAYMON. The example of such functionality may be additional data collectors that quering special equipment or modules that send notifications to the channels that a customer needs (for example, syslog or Jabber chat).
For more information on how to develop server extensions — actors — see in the examples of this section.
As already mentioned, the server extension is an actor. Actor is a module that can:
- receive messages;
- send messages:
- spawn child actors.
The main property of the actor is its complete isolation from other modules and the ability to communicate with these modules only through messages. This allows flexible scaling of actors depending on the load.
SAYMON server uses the actor model for server extensions, since it itself is implemented according to the actor model. The Comedy library is used as an implementation of the actor model. To develop server extensions, you must be familiar with this library.
The simplest example of a custom extension is a module that sends a greeting to a log. This example looks like this:
In order to load the above module into SAYMON, you need to save the code to a file (say, /tmp/saymon-modules/hello-world-actor.js), write the parameter "extension_path" to the server configuration: "/ tmp / saymon- modules "(full directory), and then restart the SAYMON server.
After that, the following message will appear in the SAYMON server log: