Skip to content

Commit

Permalink
Fix an issue related to delay confirm values
Browse files Browse the repository at this point in the history
  • Loading branch information
alinz committed May 19, 2024
1 parent 23ce938 commit 097e0a6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ func (c *Client) Get(ctx context.Context, consumerOpts ...bus.ConsumerOpt) iter.
}
}

if !yield(msg, err) {
return
}

for _, evt := range events {
if evt.ReplyCount > 0 {
confirmEvent, err := bus.NewEvent(bus.WithSubject(evt.Reply), bus.WithData([]byte(`{"type":"confirm"}`)))
Expand All @@ -212,13 +216,15 @@ func (c *Client) Get(ctx context.Context, consumerOpts ...bus.ConsumerOpt) iter.
events = nil
msg = nil
err = fmt.Errorf("%s", incoming.Data)

if !yield(msg, err) {
return
}

case "done":
return
}

if !yield(msg, err) {
break
}
}
}
}
Expand Down

0 comments on commit 097e0a6

Please sign in to comment.