doConnect method

  1. @mustCallSuper
Future<NyxxGateway> doConnect(
  1. ApiOptions apiOptions,
  2. ClientOptions clientOptions,
  3. Future<NyxxGateway> connect()
)
inherited

Perform the connection operation.

People overriding this method should call it to obtain the client instance.

Implementation

@mustCallSuper
Future<ClientType> doConnect(ApiOptions apiOptions, ClientOptions clientOptions, Future<ClientType> Function() connect) async {
  final state = await createState();
  await state.beforeConnect(apiOptions, clientOptions);

  final client = await connect();
  _states[client] = state;

  await state.afterConnect(client);
  return client;
}