Skip to content
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

Force post notification job callback to static lifetime #357

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

MeirShpilraien
Copy link
Collaborator

Post notification job callback is kept by Redis for unknown time and so we must force it live for the static lifetime. Notice that this does not mean that the value must live forever, it just means that it can not hold any none static references. For more information: https://practice.rs/lifetime/static.html#t-static

@MeirShpilraien MeirShpilraien requested a review from iddm July 25, 2023 07:13
Copy link
Collaborator

@iddm iddm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, but is this needed just for RedisGears/RedisGears#1001 ?

@MeirShpilraien
Copy link
Collaborator Author

No, its needed in general, the API today is wrong. The callback can borrow references to object that will be free before the callback is called.

@MeirShpilraien MeirShpilraien merged commit e791067 into master Jul 25, 2023
@MeirShpilraien MeirShpilraien deleted the post_notification_job_static_lifetime branch July 25, 2023 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants