diff options
Diffstat (limited to 'plugins/temporal/workflow/message_queue.go')
-rw-r--r-- | plugins/temporal/workflow/message_queue.go | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/plugins/temporal/workflow/message_queue.go b/plugins/temporal/workflow/message_queue.go index 50949897..8f4409d1 100644 --- a/plugins/temporal/workflow/message_queue.go +++ b/plugins/temporal/workflow/message_queue.go @@ -22,28 +22,20 @@ func (mq *messageQueue) flush() { mq.queue = mq.queue[0:0] } -func (mq *messageQueue) allocateMessage( - cmd interface{}, - payloads *common.Payloads, -) (id uint64, msg rrt.Message, err error) { - msg = rrt.Message{ +func (mq *messageQueue) allocateMessage(cmd interface{}, payloads *common.Payloads) (uint64, rrt.Message) { + msg := rrt.Message{ ID: mq.seqID(), Command: cmd, Payloads: payloads, } - return msg.ID, msg, nil + return msg.ID, msg } -func (mq *messageQueue) pushCommand(cmd interface{}, payloads *common.Payloads) (id uint64, err error) { - id, msg, err := mq.allocateMessage(cmd, payloads) - if err != nil { - return 0, err - } - +func (mq *messageQueue) pushCommand(cmd interface{}, payloads *common.Payloads) uint64 { + id, msg := mq.allocateMessage(cmd, payloads) mq.queue = append(mq.queue, msg) - - return id, nil + return id } func (mq *messageQueue) pushResponse(id uint64, payloads *common.Payloads) { |