Skip to content

[C#] Make IMessageRouter.GetEndpointsForUser returns async results #2232

@liumiaojq

Description

@liumiaojq

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

In our app server we have a custom router class that inherits EndpointRouterDecorator. In implementation of GetEndpointsForUser method, we need to fetch the end point for given user from Redis cache, which is an asynchronous call. However GetEndpointsForUser is not an async method, and we can't make a blocking call within GetEndpointsForUser which will block calling thread and degrades app server performance. As a result, we have to return all endpoints we have which is not very efficient because that means we have to broadcast the message of that user to all endpoints.

Describe the solution you'd like

Make IMessageRouter.GetEndpointsForUser returns async results:
Task<IEnumerable<ServiceEndpoint>> GetEndpointsForUser(string userId, IEnumerable<ServiceEndpoint> endpoints);

Additional context

Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions