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

Add the possibility to await sync events (publishAwait) #202

Open
ziadalzarka opened this issue May 8, 2021 · 3 comments
Open

Add the possibility to await sync events (publishAwait) #202

ziadalzarka opened this issue May 8, 2021 · 3 comments

Comments

@ziadalzarka
Copy link

ziadalzarka commented May 8, 2021

I ran into an issue where I want to trigger an event that I don't want my code to continue to execute before it is processed, but it's not a synchronous event.

I'm suggesting adding a new publishAwait method that makes the publish method use async/await and await the deliver function.

@ziadalzarka ziadalzarka changed the title Add the possibility to await sync events Add the possibility to await sync events (publishAwait) May 8, 2021
@mroderick
Copy link
Owner

publishSync is synchronous, execution of the calling function will not continue until the event has been propagated.

I don't understand what you're suggesting this new publishAwait method would do, that can't be accomplished with the existing methods.

@ziadalzarka
Copy link
Author

I modified the code in PR. It will execute code using async/await, publishSync doesn't wait for promises and publishAsync doesn't either. Do you understand what I mean?

@enersis-pst
Copy link

enersis-pst commented May 26, 2022

im also interesting in exact this functionality to wait for a subject.
other event listerns doesnt need for me to wait of this subject. but the whole process needs to be finished after all subjects are finished.

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.

3 participants