Skip to content

Pass the type of client to GrpcClientFactoryOptions.Creator to activate #1346

@mayuki

Description

@mayuki

Is your feature request related to a problem? Please describe.

Currently, GrpcClientFactoryOptions.Creator can implement custom client generation, but the client type is not passed to the Creator delegate, so we cannot generate a custom client.

The default activation process is to pass a type parameter to the IServiceProvider when requesting a DefaultClientActivator, so the client type is passed to the DefaultClientActivator.

var defaultClientActivator = _serviceProvider.GetService<DefaultClientActivator<TClient>>();

Describe the solution you'd like

We want to receive the client's type in a custom delegate or make ClientActivator service replaceable.

public Func<CallInvoker, Type, object>? Creator { get; set; }
var c = clientFactoryOptions.Creator(callInvoker, typeof(TClient));

Additional context

Our MagicOnion project relies on Grpc.Net, but has its own implementation at the client layer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions