DaemonClient

Truncated description of daemon for use with sendSignal function. You need to pass a daemon name and a list of signals to Signals expression list. *

template DaemonClient (
string name
Signals...
) {
enum daemonName;
}

Examples

1    // Full description of daemon
2    alias daemon = Daemon!(
3        "DaemonizeExample2",
4 
5        KeyValueList!(
6            Signal.Terminate, (logger)
7            {
8                logger.logInfo("Exiting...");
9                return false;
10           },
11            Signal.HangUp, (logger)
12            {
13                logger.logInfo("Hello World!");
14                return true;
15            },
16            RotateLogSignal, (logger)
17            {
18                logger.logInfo("Rotating log!");
19                logger.reload;
20                return true;
21            },
22            DoSomethingSignal, (logger)
23            {
24                logger.logInfo("Doing something...");
25                return true;
26            }
27        ),
28        (logger, shouldExit) 
29        {
30            // some code
31        }
32    );
33 *
34    // Truncated description for client
35    alias daemon = DaemonClient!(
36        "DaemonizeExample2",
37        Signal.Terminate,
38        Signal.HangUp,
39        RotateLogSignal,
40        DoSomethingSignal
41    );

Meta