-
Notifications
You must be signed in to change notification settings - Fork 435
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
fix(events-producer): serialize and deserialize custom events #2987
base: master
Are you sure you want to change the base?
Conversation
case 'stalled': | ||
case 'waiting': | ||
case 'waiting-children': | ||
break; |
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.
avoid to do a deserialization for these events that do not need it
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.
Fastest here would be to use a Set object that is global for this module and that provides fast check for membership.
a2d6d5c
to
115e528
Compare
@@ -40,7 +40,7 @@ export class QueueEventsProducer extends QueueBase { | |||
const args: any[] = ['MAXLEN', '~', maxEvents, '*', 'event', eventName]; | |||
|
|||
for (const [key, value] of Object.entries(restArgs)) { | |||
args.push(key, value); | |||
args.push(key, JSON.stringify(value)); |
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.
I think we are digging ourselves more into this rabbit hole, as it would have been much simpler to just allow sending strings as payloads for the custom events and let the user serialize and deserialise as they see fit, this will never be satisfactory for all cases out there...
115e528
to
23be50e
Compare
Why
Enter your explanation here.
How
Enter the implementation details here.
Additional Notes (Optional)
Any extra info here.
Ignore events that do not need this deserialization as the ones that we handled internally in this package
ref #2984