mirror of
https://github.com/postmannen/ctrl.git
synced 2025-03-31 01:24:31 +00:00
created a separate method for helloPublisher
This commit is contained in:
parent
a83029c343
commit
b564e3ebef
3 changed files with 7 additions and 7 deletions
|
@ -82,7 +82,7 @@ type process struct {
|
||||||
|
|
||||||
// handler is used to directly attach a handler to a process upon
|
// handler is used to directly attach a handler to a process upon
|
||||||
// creation of the process, like when a process is spawning a sub
|
// creation of the process, like when a process is spawning a sub
|
||||||
// process like REQCopySrc do. If we're not spawning a sub process
|
// process like copySrc do. If we're not spawning a sub process
|
||||||
// and it is a regular process the handler to use is found with the
|
// and it is a regular process the handler to use is found with the
|
||||||
// getHandler method
|
// getHandler method
|
||||||
handler func(proc process, message Message, node string) ([]byte, error)
|
handler func(proc process, message Message, node string) ([]byte, error)
|
||||||
|
|
|
@ -166,9 +166,7 @@ func (p *processes) Start(proc process) {
|
||||||
|
|
||||||
if proc.configuration.StartProcesses.StartPubHello != 0 {
|
if proc.configuration.StartProcesses.StartPubHello != 0 {
|
||||||
pf := func(ctx context.Context, procFuncCh chan Message) error {
|
pf := func(ctx context.Context, procFuncCh chan Message) error {
|
||||||
fmt.Println("\n-------------------------------------------------------------------------------------------")
|
|
||||||
fmt.Printf("--- starting up publisher for method %v\n", "hello")
|
|
||||||
fmt.Print("-------------------------------------------------------------------------------------------\n\n")
|
|
||||||
ticker := time.NewTicker(time.Second * time.Duration(p.configuration.StartProcesses.StartPubHello))
|
ticker := time.NewTicker(time.Second * time.Duration(p.configuration.StartProcesses.StartPubHello))
|
||||||
defer ticker.Stop()
|
defer ticker.Stop()
|
||||||
for {
|
for {
|
||||||
|
@ -200,7 +198,7 @@ func (p *processes) Start(proc process) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
proc.startup.subscriber(proc, Hello, pf)
|
proc.startup.subscriber(proc, HelloPublisher, pf)
|
||||||
}
|
}
|
||||||
|
|
||||||
if proc.configuration.StartProcesses.EnableKeyUpdates {
|
if proc.configuration.StartProcesses.EnableKeyUpdates {
|
||||||
|
|
|
@ -104,8 +104,9 @@ const (
|
||||||
SUBCopySrc Method = "subCopySrc"
|
SUBCopySrc Method = "subCopySrc"
|
||||||
// Write the destination copied to some node.
|
// Write the destination copied to some node.
|
||||||
SUBCopyDst Method = "subCopyDst"
|
SUBCopyDst Method = "subCopyDst"
|
||||||
// Send Hello I'm here message.
|
// Hello I'm here message.
|
||||||
Hello Method = "hello"
|
Hello Method = "hello"
|
||||||
|
HelloPublisher Method = "helloPublisher"
|
||||||
// Error log methods to centralError node.
|
// Error log methods to centralError node.
|
||||||
ErrorLog Method = "errorLog"
|
ErrorLog Method = "errorLog"
|
||||||
// Http Get
|
// Http Get
|
||||||
|
@ -187,6 +188,7 @@ func (m Method) GetMethodsAvailable() MethodsAvailable {
|
||||||
SUBCopySrc: HandlerFunc(methodSUB),
|
SUBCopySrc: HandlerFunc(methodSUB),
|
||||||
SUBCopyDst: HandlerFunc(methodSUB),
|
SUBCopyDst: HandlerFunc(methodSUB),
|
||||||
Hello: HandlerFunc(methodHello),
|
Hello: HandlerFunc(methodHello),
|
||||||
|
HelloPublisher: HandlerFunc(nil),
|
||||||
ErrorLog: HandlerFunc(methodErrorLog),
|
ErrorLog: HandlerFunc(methodErrorLog),
|
||||||
HttpGet: HandlerFunc(methodHttpGet),
|
HttpGet: HandlerFunc(methodHttpGet),
|
||||||
HttpGetScheduled: HandlerFunc(methodHttpGetScheduled),
|
HttpGetScheduled: HandlerFunc(methodHttpGetScheduled),
|
||||||
|
|
Loading…
Add table
Reference in a new issue