MetadataProvider typedef

MetadataProvider = FutureOr<void> Function(Map<String, String> metadata, String uri)

Provides per-RPC metadata.

Metadata providers will be invoked for every RPC, and can add their own metadata to the RPC. If the function returns a Future, the RPC will await completion of the returned Future before transmitting the request.

The metadata provider is given the current metadata map (possibly modified by previous metadata providers) and the uri that is being called, and is expected to modify the map before returning or before completing the returned Future.


typedef MetadataProvider = FutureOr<void> Function(
    Map<String, String> metadata, String uri);