You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
@justdmitry - So this is an interesting question. While in most cases it is proper to implement the IDisposible class, we don't necessarily want to encourage the using syntax. For example:
In most cases, the QueueClient is long-lived, and a Windows service would create a single client and use it throughout the application.
What we ultimately want to avoid, is customers using the above example (using statement) repeatedly throughout their application. Under the covers this is creating a connection, sending a single message, and then closing the connection, which is a heavy series of operations.
Do you recommend (for web app) register it as a singleton for whole app lifetime? Does QueueClient/TopicClient are (or planned to be in RTM) thread-safe?
ClientEntity
(and it successors) have publicCloseAsync
method, which indicates that "good practice" is to close each client/entity after use.For many years, this is known as Dispose pattern, and special
IDisposable
interface andusing
language construct are created for this scenario.Please, add
IDisposable
interface toClientEntity
class.The text was updated successfully, but these errors were encountered: