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

Events: Support for all_nodes argument in EventStream.subscribe #492

Open
martastain opened this issue Jan 20, 2025 · 0 comments · May be fixed by #495
Open

Events: Support for all_nodes argument in EventStream.subscribe #492

martastain opened this issue Jan 20, 2025 · 0 comments · May be fixed by #495
Assignees

Comments

@martastain
Copy link
Member

martastain commented Jan 20, 2025

When an event is created and there's a subscriber attached to the topic, only the current instance runs the function.
This is ideal, when we want to react to the event only once - for example: "Entity status change sends a notification".

When Ayon is scaled (there are multiple instances of the server itself), we also need a way how to trigger the function on all instances.
For example "Settings of the addon changed, so all addon instances has to reload the cache".

Proposal:

Add another parameter all_nodes: bool (defaulting to False) to EventStream.subscribe method.
When set to True, the function will be triggered on all instances of the server.

Implementation:

Hooks need to be split to groups (all / current node). Implementation for current node remains the same,
while all_nodes require implementation in ayon_server.api.messaging

@martastain martastain added type: feature Adding something new and exciting to the product and removed type: feature Adding something new and exciting to the product labels Jan 20, 2025
@martastain martastain self-assigned this Jan 22, 2025
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 a pull request may close this issue.

1 participant