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

Implement Async Get/Delete #539

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

thinkbeforecoding
Copy link

@thinkbeforecoding thinkbeforecoding commented Jan 18, 2022

This PR implement Task based async for GetMessage/DeleteMessage.

I have an extra question on this. Would it be ok to also implement GetMessage on IJetStream ? It would return a Msg instead of MsgInfo in that case.

#540

@sixlettervariables
Copy link
Collaborator

@thinkbeforecoding can you open an issue to track your question regarding the other method family.

@scottf
Copy link
Collaborator

scottf commented Jan 19, 2022

@thinkbeforecoding a couple things. Please sign your commits, this is the policy for our repos.

Regarding the change, you could always do it yourself by wrapping the sync call. The problem with adding this to the api is that we have to consider it in all clients, not that all clients have to be exactly equal but we do try to maintain some amount of parity. And since you can wrap the call yourself and the management context is actually very light, I don't see the problem with using both the management api and the regular api. We are really just separating concerns by having different interfaces.

@scottf
Copy link
Collaborator

scottf commented Jan 19, 2022

Also GetMessage is a JS API call, which is why it returns MessageInfo instead of a Message, which is returned in subscriptions.

@sixlettervariables
Copy link
Collaborator

In .NET you should avoid wrapping sync in async calls whenever possible. "Turtles all the way down" is best, so to speak.

@thinkbeforecoding
Copy link
Author

I'm ok to leave GetMessage in the management api. But having an Async version (returning a task) is very important for .Net performance.

@thinkbeforecoding
Copy link
Author

I signed the commit 👍

@scottf
Copy link
Collaborator

scottf commented Jun 15, 2022

This will be addressed in V2

@JohannesEH
Copy link
Contributor

@scottf Any more details about v2? Do you have an idea of how far down the line it is? Like this year, next year? Is it a complete rewrite?

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.

None yet

4 participants