-
Notifications
You must be signed in to change notification settings - Fork 805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite async workflow queue provider component #5648
Conversation
d8101ac
to
d2f6104
Compare
|
||
func (d *decoderImpl) Decode(out any) error { | ||
if d.blob.GetEncodingType() != types.EncodingTypeJSON { | ||
return fmt.Errorf("unsupported encoding type %v", d.blob.GetEncodingType()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's mention supported encoding types in the error message
// PutIfNotExist is thread safe, and will either return the value that was already in the cache or the value we just created | ||
// another thread might have inserted a value between the Get and PutIfNotExist, but that is ok | ||
// it should never return an error as we do not use Pin | ||
val, err = q.producerCache.PutIfNotExist(queueID, producer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
side comment: a better semantic for this would be PutIfNotExist(key string, valueCreator func() any)
so we could avoid the potential duplicate initialization problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that requires rewriting cache implementation, will not do it in this pr
d2f6104
to
bb1cecb
Compare
What changed?
Rewrite async workflow queue provider component
Why?
The old design doesn't support our use case
How did you test it?
unit tests
Potential risks
Release notes
Documentation Changes