Interface IEnvironment
The IEnvironment is the main entry point to a node or a cluster of nodes.
The CreateConnectionAsync(ConnectionSettings) and parameterless
CreateConnectionAsync() methods allow creating IConnection instances.
Connection affinity can be configured via Affinity, typically using
a ConnectionSettingsBuilder.Affinity(...) call when constructing the settings.
An application is expected to maintain a single IEnvironment instance and to close that instance
upon application exit.
IEnvironment instances are expected to be thread-safe.
public interface IEnvironment
Methods
CloseAsync()
Close this environment and its resources.
Task CloseAsync()
Returns
CreateConnectionAsync(ConnectionSettings, CancellationToken)
Create a new IConnection with the given connection settings.
Task<IConnection> CreateConnectionAsync(ConnectionSettings connectionSettings, CancellationToken cancellationToken = default)
Parameters
connectionSettingsConnectionSettingscancellationTokenCancellationToken
Returns
- Task<IConnection>
Task<TResult> instance.
CreateConnectionAsync(CancellationToken)
Create a new IConnection with the default connection settings.
Task<IConnection> CreateConnectionAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
- Task<IConnection>
Task<TResult> instance.