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.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))

View file

@ -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
}