I would like to provide a cancellation token, or a method on the ConnectionFactory object that I can call to have it stop trying to create a connection. When reconnectOnConnect = true, then the ConnectionFactory.CreateConnection will block until it creates the connection, which is fine, but I don't have a way of stopping it. It'd be really great if it was async, too.
Use case
I want to be able to have the NATS client run before the server may be available. But then if the user wants to stop the client, and perhaps change config, then I want to be able to stop and re-start the ConnectionFactory.CreateConnection method
Proposed change
I would like to provide a cancellation token, or a method on the
ConnectionFactory
object that I can call to have it stop trying to create a connection. WhenreconnectOnConnect = true
, then theConnectionFactory.CreateConnection
will block until it creates the connection, which is fine, but I don't have a way of stopping it. It'd be really great if it was async, too.Use case
I want to be able to have the NATS client run before the server may be available. But then if the user wants to stop the client, and perhaps change config, then I want to be able to stop and re-start the
ConnectionFactory.CreateConnection
methodContribution
No response