-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Support IAsyncDisposable services #1582
Labels
Comments
Thanks for your feedback, Will be improved in the next version. |
yang-xiaodong
added a commit
that referenced
this issue
Sep 20, 2024
Fixed in version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CAP subscribe currently does not work if I use scoped service that implements
IAsyncDisposable
but does not implementIDisposable
. For example:Exception is thrown while handling event:
This happens because CAP does use IServiceScope which does not support
IAsyncDisposable
services.Proposed solution:
Change this line https://github.com/dotnetcore/CAP/blob/master/src/DotNetCore.CAP/Internal/ISubscribeInvoker.Default.cs#L44C9-L44C58
To:
The text was updated successfully, but these errors were encountered: