getConnection method
Implementation
RubixServiceClient getConnection(
{required String gateway,
required String accessToken,
Duration idleTimeout = const Duration(minutes: 5)}) {
ClientChannel channel = ClientChannel(gateway,
port: Const.PORT,
options: ChannelOptions(
credentials: ChannelCredentials.insecure(),
idleTimeout: idleTimeout));
return RubixServiceClient(channel,
options:
CallOptions(metadata: {'Authorization': 'Bearer $accessToken'}));
}