createCall<Q, R> method

  1. @override
ClientCall<Q, R> createCall<Q, R>(
  1. ClientMethod<Q, R> method,
  2. Stream<Q> requests,
  3. CallOptions options
)
override

Initiates a new RPC on this connection.

Implementation

@override
ClientCall<Q, R> createCall<Q, R>(ClientMethod<Q, R> method, Stream<Q> requests, CallOptions options) {
  if (!SessionsClient.unallowedMethods.contains(method.path) && _sessionId != null) {
    options = options.mergedWith(CallOptions(metadata: {SessionsClient.sessionMetadataKey: _sessionId!()}));
  }

  options = options.mergedWith(CallOptions(metadata: {'Authorization': 'Bearer $accessToken'}));
  options = options.mergedWith(CallOptions(metadata: {'viam_client': getVersionMetadata()}));
  return super.createCall(method, requests, options);
}