From 7522bc203d7aa48b9150fca461c27496ef82d61e Mon Sep 17 00:00:00 2001 From: postmannen Date: Wed, 20 Apr 2022 06:41:45 +0200 Subject: [PATCH] removed not needed REQToSocket --- processes.go | 11 ----------- requests.go | 30 +----------------------------- 2 files changed, 1 insertion(+), 40 deletions(-) diff --git a/processes.go b/processes.go index ac2e610..2b212c3 100644 --- a/processes.go +++ b/processes.go @@ -200,8 +200,6 @@ func (p *processes) Start(proc process) { proc.startup.subREQRelayInitial(proc) - proc.startup.subREQToSocket(proc) - proc.startup.subREQPublicKey(proc) } @@ -311,7 +309,6 @@ func (s startup) pubREQPublicKeysGet(p process) { // Define the procFunc to be used for the process. proc.procFunc = func(ctx context.Context, procFuncCh chan Message) error { - // TODO: replace this with a separate timer for the request type. ticker := time.NewTicker(time.Second * time.Duration(p.configuration.PublicKeysGetInterval)) for { @@ -520,14 +517,6 @@ func (s startup) subREQRelayInitial(p process) { go proc.spawnWorker() } -func (s startup) subREQToSocket(p process) { - log.Printf("Starting write to socket subscriber: %#v\n", p.node) - sub := newSubject(REQToSocket, string(p.node)) - proc := newProcess(p.ctx, s.server, sub, processKindSubscriber, nil) - - go proc.spawnWorker() -} - func (s startup) subREQPublicKey(p process) { log.Printf("Starting get Public Key subscriber: %#v\n", p.node) sub := newSubject(REQPublicKey, string(p.node)) diff --git a/requests.go b/requests.go index 61eb915..2fd3c92 100644 --- a/requests.go +++ b/requests.go @@ -127,8 +127,6 @@ const ( // Tail file REQTailFile Method = "REQTailFile" // Write to steward socket - REQToSocket Method = "REQToSocket" - // Send a message via a node REQRelay Method = "REQRelay" // The method handler for the first step in a relay chain. REQRelayInitial Method = "REQRelayInitial" @@ -212,9 +210,6 @@ func (m Method) GetMethodsAvailable() MethodsAvailable { REQTailFile: methodREQTailFile{ event: EventACK, }, - REQToSocket: methodREQToSocket{ - event: EventACK, - }, REQRelay: methodREQRelay{ event: EventACK, }, @@ -240,7 +235,7 @@ func (m Method) GetMethodsAvailable() MethodsAvailable { // the Stew client for knowing what of the req types are generally // used as reply methods. func (m Method) GetReplyMethods() []Method { - rm := []Method{REQToConsole, REQTuiToConsole, REQCliCommand, REQCliCommandCont, REQToFile, REQToFileAppend, REQToSocket, REQNone} + rm := []Method{REQToConsole, REQTuiToConsole, REQCliCommand, REQCliCommandCont, REQToFile, REQToFileAppend, REQNone} return rm } @@ -1827,29 +1822,6 @@ func (m methodREQCliCommandCont) handler(proc process, message Message, node str // --- -type methodREQToSocket struct { - event Event -} - -func (m methodREQToSocket) getKind() Event { - return m.event -} - -// TODO: Not implemented. -// Handler to write to unix socket file. -func (m methodREQToSocket) handler(proc process, message Message, node string) ([]byte, error) { - - // for _, d := range message.Data { - // // TODO: Write the data to the socket here. - // // fmt.Printf("Info: REQToSocket is not yet implemented. Data to write to socket: %v\n", d) - // } - - ackMsg := []byte("confirmed from: " + node + ": " + fmt.Sprint(message.ID)) - return ackMsg, nil -} - -// ---- - type methodREQRelayInitial struct { event Event }