1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2025-03-05 06:46:48 +00:00

renamed newSAM to newSubjectAndMessage

This commit is contained in:
postmannen 2021-08-25 08:56:44 +02:00
parent ac932ac2c9
commit 7367710747
3 changed files with 8 additions and 8 deletions

View file

@ -200,7 +200,7 @@ func (s startup) pubREQHello(p process) {
Method: REQHello,
}
sam, err := newSAM(m)
sam, err := newSubjectAndMessage(m)
if err != nil {
// In theory the system should drop the message before it reaches here.
log.Printf("error: ProcessesStart: %v\n", err)

View file

@ -166,7 +166,7 @@ func convertBytesToSAM(b []byte) ([]subjectAndMessage, error) {
// Range over all the messages parsed from json, and create a subject for
// each message.
for _, m := range MsgSlice {
sm, err := newSAM(m)
sm, err := newSubjectAndMessage(m)
if err != nil {
log.Printf("error: jsonFromFileData: %v\n", err)
continue
@ -177,10 +177,10 @@ func convertBytesToSAM(b []byte) ([]subjectAndMessage, error) {
return sam, nil
}
// newSAM will look up the correct values and value types to
// newSubjectAndMessage will look up the correct values and value types to
// be used in a subject for a Message (sam), and return the a combined structure
// of type subjectAndMessage.
func newSAM(m Message) (subjectAndMessage, error) {
func newSubjectAndMessage(m Message) (subjectAndMessage, error) {
// We need to create a tempory method type to look up the kind for the
// real method for the message.
var mt Method
@ -198,10 +198,10 @@ func newSAM(m Message) (subjectAndMessage, error) {
Method: m.Method,
}
sm := subjectAndMessage{
sam := subjectAndMessage{
Subject: sub,
Message: m,
}
return sm, nil
return sam, nil
}

View file

@ -281,14 +281,14 @@ func newReplyMessage(proc process, message Message, outData []byte) {
PreviousMessage: &message,
}
nSAM, err := newSAM(newMsg)
sam, err := newSubjectAndMessage(newMsg)
if err != nil {
// In theory the system should drop the message before it reaches here.
er := fmt.Errorf("error: newReplyMessage : %v, message: %v", err, message)
sendErrorLogMessage(proc.toRingbufferCh, proc.node, er)
log.Printf("%v\n", er)
}
proc.toRingbufferCh <- []subjectAndMessage{nSAM}
proc.toRingbufferCh <- []subjectAndMessage{sam}
}
// ------------------------------------------------------------