mirror of
https://github.com/postmannen/ctrl.git
synced 2024-12-14 12:37:31 +00:00
sub procs req use the same logic as normal req's for validation
This commit is contained in:
parent
c4e384b987
commit
fe78d6c070
2 changed files with 16 additions and 10 deletions
|
@ -351,7 +351,8 @@ func (m Method) GetReplyMethods() []Method {
|
|||
// as input argument.
|
||||
func (m Method) getHandler(method Method) methodHandler {
|
||||
ma := m.GetMethodsAvailable()
|
||||
mh := ma.Methodhandlers[method]
|
||||
mh, _ := ma.CheckIfExists(method)
|
||||
// mh := ma.Methodhandlers[method]
|
||||
|
||||
return mh
|
||||
}
|
||||
|
|
|
@ -240,7 +240,7 @@ func copySrcSubHandler(cia copyInitialData) func(process, Message, string) ([]by
|
|||
// HERE!
|
||||
// We should receive a ready message generated by the procFunc of Dst.
|
||||
|
||||
fmt.Printf("\n-----------------RECEIVED COPY READY MESSAGE------------------\n\n")
|
||||
fmt.Printf("\n-----------------RECEIVED COPY READY MESSAGE IN copySrcSubHandler------------------\n\n")
|
||||
|
||||
select {
|
||||
case <-proc.ctx.Done():
|
||||
|
@ -299,15 +299,20 @@ func copyDstProcSubFunc(proc process, cia copyInitialData, message Message) func
|
|||
ReplyMethod: REQNone,
|
||||
}
|
||||
|
||||
sub := Subject{
|
||||
ToNode: string(message.FromNode),
|
||||
Event: EventACK,
|
||||
Method: cia.SrcMethod,
|
||||
}
|
||||
// sub := Subject{
|
||||
// ToNode: string(message.FromNode),
|
||||
// Event: EventACK,
|
||||
// Method: cia.SrcMethod,
|
||||
// }
|
||||
//
|
||||
// sam := subjectAndMessage{
|
||||
// Subject: sub,
|
||||
// Message: msg,
|
||||
// }
|
||||
|
||||
sam := subjectAndMessage{
|
||||
Subject: sub,
|
||||
Message: msg,
|
||||
sam, err := newSubjectAndMessage(msg)
|
||||
if err != nil {
|
||||
log.Fatalf("copyDstProcSubFunc: newSubjectAndMessage failed: %v\n", err)
|
||||
}
|
||||
|
||||
proc.toRingbufferCh <- []subjectAndMessage{sam}
|
||||
|
|
Loading…
Reference in a new issue