From 97d5da948f286327cc824a693e88b0eff5a3c706 Mon Sep 17 00:00:00 2001 From: postmannen Date: Wed, 27 Nov 2024 12:58:52 +0100 Subject: [PATCH] renamed process spawnworker() to start() --- process.go | 5 ++--- processes.go | 4 ++-- requests_copy.go | 4 ++-- requests_operator.go | 2 +- server.go | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/process.go b/process.go index 6f26689..681ddf0 100644 --- a/process.go +++ b/process.go @@ -153,8 +153,7 @@ func newProcess(ctx context.Context, server *server, subject Subject, processKin // We use the full name of the subject to identify a unique // process. We can do that since a process can only handle - // one message queue. - + // one request type. if proc.processKind == processKindPublisher { proc.processName = processNameGet(proc.subject.name(), processKindPublisher) } @@ -172,7 +171,7 @@ func newProcess(ctx context.Context, server *server, subject Subject, processKin // // It will give the process the next available ID, and also add the // process to the processes map in the server structure. -func (p process) spawnWorker() { +func (p process) start() { // Add prometheus metrics for the process. if !p.isSubProcess { diff --git a/processes.go b/processes.go index 469af34..8edd819 100644 --- a/processes.go +++ b/processes.go @@ -385,7 +385,7 @@ func (s *startup) subscriber(p process, m Method, pf func(ctx context.Context, p proc := newProcess(p.ctx, p.processes.server, sub, processKindSubscriber) proc.procFunc = pf - go proc.spawnWorker() + go proc.start() } // publisher will start a publisher process. It takes the initial process, request method, @@ -398,7 +398,7 @@ func (s *startup) publisher(p process, m Method, pf func(ctx context.Context, pr proc.procFunc = pf proc.isLongRunningPublisher = true - go proc.spawnWorker() + go proc.start() } // --------------------------------------------------------------- diff --git a/requests_copy.go b/requests_copy.go index 5ee74e9..1085a49 100644 --- a/requests_copy.go +++ b/requests_copy.go @@ -235,7 +235,7 @@ func methodCopySrc(proc process, message Message, node string) ([]byte, error) { copySrcSubProc.handler = copySrcSubHandler() // The process will be killed when the context expires. - go copySrcSubProc.spawnWorker() + go copySrcSubProc.start() // Send a message over the the node where the destination file will be written, // to also start up a sub process on the destination node. @@ -362,7 +362,7 @@ func methodCopyDst(proc process, message Message, node string) ([]byte, error) { copyDstSubProc.handler = copyDstSubHandler() // The process will be killed when the context expires. - go copyDstSubProc.spawnWorker() + go copyDstSubProc.start() fp := filepath.Join(cia.DstDir, cia.DstFile) replyData := fmt.Sprintf("info: succesfully initiated copy source process: procName=%v, srcNode=%v, dstPath=%v, starting sub process=%v for the actual copying", copyDstSubProc.processName, node, fp, subProcessName) diff --git a/requests_operator.go b/requests_operator.go index 743a032..6de3ba2 100644 --- a/requests_operator.go +++ b/requests_operator.go @@ -69,7 +69,7 @@ func methodOpProcessStart(proc process, message Message, node string) ([]byte, e // Create the process and start it. sub := newSubject(method, proc.configuration.NodeName) procNew := newProcess(proc.ctx, proc.server, sub, processKindSubscriber) - go procNew.spawnWorker() + go procNew.start() txt := fmt.Sprintf("info: OpProcessStart: started id: %v, subject: %v: node: %v", procNew.processID, sub, message.ToNode) er := fmt.Errorf("%v", txt) diff --git a/server.go b/server.go index bc4d744..c8102db 100644 --- a/server.go +++ b/server.go @@ -600,7 +600,7 @@ func (s *server) routeMessagesToProcess() { proc = newProcess(s.ctx, s, sub, processKindPublisher) } - proc.spawnWorker() + proc.start() er = fmt.Errorf("info: processNewMessages: new process started, subject: %v, processID: %v", subjName, proc.processID) s.errorKernel.logDebug(er)