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

added replyMethodTimeout to message

This commit is contained in:
postmannen 2021-09-16 12:37:46 +02:00
parent b279cf40bf
commit d5082cc7a4
3 changed files with 16 additions and 6 deletions

View file

@ -475,11 +475,15 @@ method
// Additional arguments that might be needed when executing the
// method. Can be f.ex. an ip address if it is a tcp sender, or the
// shell command to execute in a cli session.
MethodArgs []string `json:"methodArgs" yaml:"methodArgs"`
MethodArgs []string
// ReplyMethod, is the method to use for the reply message.
// By default the reply method will be set to log to file, but
// you can override it setting your own here.
replyMethod
// Additional arguments that might be needed when executing the reply
// method. Can be f.ex. an ip address if it is a tcp sender, or the
// shell command to execute in a cli session.
ReplyMethodArgs []string
// Initial message Reply ACK wait timeout
ACKTimeout
// Normal Resend retries
@ -490,6 +494,8 @@ replyACKTimeout
replyRetries
// Timeout for long a process should be allowed to operate
methodTimeout
// Timeout for long a process should be allowed to operate
ReplyMethodTimeout int
// Directory is a string that can be used to create the
//directory structure when saving the result of some method.
// For example "syslog","metrics", or "metrics/mysensor"

View file

@ -52,6 +52,8 @@ type Message struct {
ReplyRetries int `json:"replyRetries" yaml:"replyRetries"`
// Timeout for long a process should be allowed to operate
MethodTimeout int `json:"methodTimeout" yaml:"methodTimeout"`
// Timeout for long a process should be allowed to operate
ReplyMethodTimeout int `json:"replyMethodTimeout" yaml:"replyMethodTimeout"`
// Directory is a string that can be used to create the
//directory structure when saving the result of some method.
// For example "syslog","metrics", or "metrics/mysensor"

View file

@ -271,11 +271,13 @@ func newReplyMessage(proc process, message Message, outData []byte) {
// Create a new message for the reply, and put it on the
// ringbuffer to be published.
newMsg := Message{
ToNode: message.FromNode,
Data: []string{string(outData)},
Method: message.ReplyMethod,
ACKTimeout: message.ReplyACKTimeout,
Retries: message.ReplyRetries,
ToNode: message.FromNode,
Data: []string{string(outData)},
Method: message.ReplyMethod,
MethodArgs: message.ReplyMethodArgs,
MethodTimeout: message.ReplyMethodTimeout,
ACKTimeout: message.ReplyACKTimeout,
Retries: message.ReplyRetries,
// Put in a copy of the initial request message, so we can use it's properties if
// needed to for example create the file structure naming on the subscriber.