Skip to content

IProbingRequestFactory.CreateRequest parameters are artificially limiting #2890

@MihaZupan

Description

@MihaZupan

HttpRequestMessage CreateRequest(ClusterModel cluster, DestinationModel destination);

These being ClusterModel and DestinationModel make it unnecessarily hard to retrieve certain information, like the current health state of the destination, or even its ID.
We should consider accepting ClusterState and DestinationState here instead.

I didn't see any discussion about this specific API shape in #459.

Not sure it's worth a full breaking change, but we could do it by e.g. exposing a new overload with a DIM and optionally obsoleting the existing one.

ValueTask<HttpRequestMessage> CreateRequestAsync(ClusterState cluster, DestinationState destination) =>
    ValueTask.FromResult(CreateRequest(cluster.Model, destination.Model));

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions