-
Notifications
You must be signed in to change notification settings - Fork 118
Impossible to know if underlying connection is shared or not #482
Comments
What is the real-world use case here? |
Trying to implement
In an application that span a larger code base, getting a sender from a pool (creation) and returning (verification that sender owns its connection) are not necessarily related. |
@nemakam I could send a PR if you'd like. |
@SeanFeldman |
Yep. Exactly that. Will send the PRs shortly.
|
When clients are created, they can be instantiated with a
connection-string
or aconnection
.The second method allows
connection
sharing. It is also exposed viaIClientEntity.ServiceBusConnection
. Unfortunately, there's no was to know ifconnection
is owned by a client or not.In scenarios, where a decision has to be made based on the fact that a client does or does not own a connection, there's no way to determine that information. The information is stored internally on each client, and could be exposed via
IClientEntity
as a read-only property.Suggestion - expose
OwnsConnection
read-only property onIClientEntity
for all clients to implement.Modifying
IClientEntity
would cause a breaking change and require a new major version.Alternative route would be to introduce
OwnsConnection
in a minor release and expose as part of theIClientEntity
interface in the next major.Versions
The text was updated successfully, but these errors were encountered: