1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2024-12-14 12:37:31 +00:00

removed not needed REQToSocket

This commit is contained in:
postmannen 2022-04-20 06:41:45 +02:00
parent 102cfd43c9
commit 7522bc203d
2 changed files with 1 additions and 40 deletions

View file

@ -200,8 +200,6 @@ func (p *processes) Start(proc process) {
proc.startup.subREQRelayInitial(proc) proc.startup.subREQRelayInitial(proc)
proc.startup.subREQToSocket(proc)
proc.startup.subREQPublicKey(proc) proc.startup.subREQPublicKey(proc)
} }
@ -311,7 +309,6 @@ func (s startup) pubREQPublicKeysGet(p process) {
// Define the procFunc to be used for the process. // Define the procFunc to be used for the process.
proc.procFunc = func(ctx context.Context, procFuncCh chan Message) error { 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)) ticker := time.NewTicker(time.Second * time.Duration(p.configuration.PublicKeysGetInterval))
for { for {
@ -520,14 +517,6 @@ func (s startup) subREQRelayInitial(p process) {
go proc.spawnWorker() 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) { func (s startup) subREQPublicKey(p process) {
log.Printf("Starting get Public Key subscriber: %#v\n", p.node) log.Printf("Starting get Public Key subscriber: %#v\n", p.node)
sub := newSubject(REQPublicKey, string(p.node)) sub := newSubject(REQPublicKey, string(p.node))

View file

@ -127,8 +127,6 @@ const (
// Tail file // Tail file
REQTailFile Method = "REQTailFile" REQTailFile Method = "REQTailFile"
// Write to steward socket // Write to steward socket
REQToSocket Method = "REQToSocket"
// Send a message via a node
REQRelay Method = "REQRelay" REQRelay Method = "REQRelay"
// The method handler for the first step in a relay chain. // The method handler for the first step in a relay chain.
REQRelayInitial Method = "REQRelayInitial" REQRelayInitial Method = "REQRelayInitial"
@ -212,9 +210,6 @@ func (m Method) GetMethodsAvailable() MethodsAvailable {
REQTailFile: methodREQTailFile{ REQTailFile: methodREQTailFile{
event: EventACK, event: EventACK,
}, },
REQToSocket: methodREQToSocket{
event: EventACK,
},
REQRelay: methodREQRelay{ REQRelay: methodREQRelay{
event: EventACK, event: EventACK,
}, },
@ -240,7 +235,7 @@ func (m Method) GetMethodsAvailable() MethodsAvailable {
// the Stew client for knowing what of the req types are generally // the Stew client for knowing what of the req types are generally
// used as reply methods. // used as reply methods.
func (m Method) GetReplyMethods() []Method { 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 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 { type methodREQRelayInitial struct {
event Event event Event
} }