GetNewStartingClient Method
GetNewStartingClient(CancellationToken)
Gets a new starting IHazelcastClient instance with automatic options.
Declaration
[Obsolete("The method is obsolete. Use other overloads.", true)]
public static HazelcastClientStart GetNewStartingClient(CancellationToken cancellationToken = default)
Parameters
CancellationToken | cancellationToken | A optional cancellation token. |
Returns
HazelcastClientStart | A HazelcastClientStart instance which exposes the IHazelcastClient itself, along with a Task representing the start operation. |
Remarks
The IHazelcastClient instance is starting, but not started yet. Its start operation is represented by the returned Task, which will complete when the client has started, or when starting has failed. Trying to use the client before the start Task has completed can have unspecified results, including throwing exceptions. Make sure that the start Task has actually completed before using the client.
In any case, the start Task must be awaited, as it may fail with an exception that must be observed.
Options are built via the
By default, the client connection timeout is infinite. If this method cannot establish a connection to a cluster at the configured addresses, it may appear to hang as it retries forever. You may want to configure a timeout via the options.Networking.ConnectionRetry.ClusterConnectionTimeoutMilliseconds configuration option.
GetNewStartingClient(Action<HazelcastOptions>, CancellationToken)
Gets a new starting IHazelcastClient instance with configured options.
Declaration
public static HazelcastClientStart GetNewStartingClient(Action<HazelcastOptions> configure, CancellationToken cancellationToken = default)
Parameters
Action<HazelcastOptions> | configure | A HazelcastOptions configuration delegate. |
CancellationToken | cancellationToken | A optional cancellation token. |
Returns
HazelcastClientStart | A HazelcastClientStart instance which exposes the IHazelcastClient itself, along with a Task representing the start operation. |
Remarks
The IHazelcastClient instance is starting, but not started yet. Its start operation is represented by the returned Task, which will complete when the client has started, or when starting has failed. Trying to use the client before the start Task has completed can have unspecified results, including throwing exceptions. Make sure that the start Task has actually completed before using the client.
In any case, the start Task must be awaited, as it may fail with an exception that must be observed.
Options are built via the configure
method,
where they can be refined and adjusted, before being used to create the client.
By default, the client connection timeout is infinite. If this method cannot establish a connection to a cluster at the configured addresses, it may appear to hang as it retries forever. You may want to configure a timeout via the options.Networking.ConnectionRetry.ClusterConnectionTimeoutMilliseconds configuration option.
GetNewStartingClient(HazelcastOptions, CancellationToken)
Gets a new starting IHazelcastClient instance with options.
Declaration
public static HazelcastClientStart GetNewStartingClient(HazelcastOptions options, CancellationToken cancellationToken = default)
Parameters
HazelcastOptions | options | Options. |
CancellationToken | cancellationToken | A optional cancellation token. |
Returns
HazelcastClientStart | A HazelcastClientStart instance which exposes the IHazelcastClient itself, along with a Task representing the start operation. |
Remarks
The IHazelcastClient instance is starting, but not started yet. Its start operation is represented by the returned Task, which will complete when the client has started, or when starting has failed. Trying to use the client before the start Task has completed can have unspecified results, including throwing exceptions. Make sure that the start Task has actually completed before using the client.
In any case, the start Task must be awaited, as it may fail with an exception that must be observed.
By default, the client connection timeout is infinite. If this method cannot establish a connection to a cluster at the configured addresses, it may appear to hang as it retries forever. You may want to configure a timeout via the options.Networking.ConnectionRetry.ClusterConnectionTimeoutMilliseconds configuration option.