Skip to content

SubscribeToResourceAsync is difficult to use #1067

@ericstj

Description

@ericstj

Discussed here #1001 (comment)

It's not clear how to use SubscribeToResourceAsync from the signature / docs. You can subscribe, but what gets notified? To remove the subscription you need to Unsubscribe, which is different than RegisterNotificationHandler which provides an IAsyncDisposable for removal.

We discussed adding an overload for SubscribeToResourceAsync that would accept the handler and return an IAsyncDisposable. This would allow for a single call to subscribe without needing to handle unsubscribe separately.

We should also improve the documents for Subscribe/Unsubscribe/Register so it's clear how they work together.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions