Specifying parameters when spawning
When spawning a monitor instance, you can pass parameters to an action. For example:
monitor m {
action onload() {
spawn forward("a", "channelA");
spawn forward("b", "channelB");
}
action forward(string arg, string channel) {
on all Event(arg) as e {
send e to channel;
}
on StopForwarding(arg) {
die;
}
}
}