Skip to content

Conversation

@LucDeCaf
Copy link
Contributor

A common convention in .NET for managing/cleaning up resources for cancellable operations is to return an IDisposable type. Consumers can then use using var subscription = ..., which automatically calls subscription.Dispose() when subscription leaves scope.

This PR returns an IDisposable from the Watch method which users can use to stop watching queries. The old SQLWatchOptions.Signal approach is still available for users which need the ability to stop watching the query from within the OnResult or OnError callbacks, or who prefer to work with CancellationTokens. Also removes a potential memory caused from never cleaning up a CancellationToken.Register call.

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