2021-02-24 10:58:02 +01:00
|
|
|
package steward
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (s *server) subscribersStart() {
|
2021-03-01 12:16:36 +01:00
|
|
|
// Start a subscriber for CLICommand messages
|
2021-02-24 10:58:02 +01:00
|
|
|
{
|
2021-03-01 12:16:36 +01:00
|
|
|
fmt.Printf("Starting CLICommand subscriber: %#v\n", s.nodeName)
|
|
|
|
sub := newSubject(CLICommand, CommandACK, s.nodeName)
|
2021-03-04 06:53:03 +01:00
|
|
|
proc := newProcess(s.processes, sub, s.errorKernel.errorCh, processKindSubscriber, []node{"central", "ship2"})
|
2021-02-24 10:58:02 +01:00
|
|
|
// fmt.Printf("*** %#v\n", proc)
|
2021-03-03 14:14:32 +01:00
|
|
|
go proc.spawnWorker(s)
|
2021-02-24 10:58:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Start a subscriber for textLogging messages
|
|
|
|
{
|
|
|
|
fmt.Printf("Starting textlogging subscriber: %#v\n", s.nodeName)
|
|
|
|
sub := newSubject(TextLogging, EventACK, s.nodeName)
|
2021-03-04 06:53:03 +01:00
|
|
|
proc := newProcess(s.processes, sub, s.errorKernel.errorCh, processKindSubscriber, []node{"*"})
|
2021-02-24 10:58:02 +01:00
|
|
|
// fmt.Printf("*** %#v\n", proc)
|
2021-03-03 14:14:32 +01:00
|
|
|
go proc.spawnWorker(s)
|
2021-02-24 10:58:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Start a subscriber for SayHello messages
|
|
|
|
{
|
|
|
|
fmt.Printf("Starting SayHello subscriber: %#v\n", s.nodeName)
|
|
|
|
sub := newSubject(SayHello, EventNACK, s.nodeName)
|
2021-03-04 06:53:03 +01:00
|
|
|
proc := newProcess(s.processes, sub, s.errorKernel.errorCh, processKindSubscriber, []node{"*"})
|
2021-02-24 10:58:02 +01:00
|
|
|
// fmt.Printf("*** %#v\n", proc)
|
2021-03-03 14:14:32 +01:00
|
|
|
go proc.spawnWorker(s)
|
2021-02-24 10:58:02 +01:00
|
|
|
}
|
2021-02-24 15:43:31 +01:00
|
|
|
|
|
|
|
if s.centralErrorLogger {
|
|
|
|
// Start a subscriber for ErrorLog messages
|
|
|
|
{
|
|
|
|
fmt.Printf("Starting ErrorLog subscriber: %#v\n", s.nodeName)
|
|
|
|
sub := newSubject(ErrorLog, EventNACK, "errorCentral")
|
2021-03-04 06:53:03 +01:00
|
|
|
proc := newProcess(s.processes, sub, s.errorKernel.errorCh, processKindSubscriber, []node{"*"})
|
2021-02-24 15:43:31 +01:00
|
|
|
// fmt.Printf("*** %#v\n", proc)
|
2021-03-03 14:14:32 +01:00
|
|
|
go proc.spawnWorker(s)
|
2021-02-24 15:43:31 +01:00
|
|
|
}
|
|
|
|
}
|
2021-02-24 10:58:02 +01:00
|
|
|
}
|