NGitLab icon indicating copy to clipboard operation
NGitLab copied to clipboard

GetJobsAsync(PipelineJobQuery query) appears not to be async

Open jhueppauff opened this issue 1 year ago • 1 comments

Hi,

I came across the method GetJobsAsync() in the PipelineClient which from the naming seems to be async, but the implementation doesn't really look like it supports async operations?

image

https://github.com/ubisoft/NGitLab/blob/main/NGitLab.Mock/Clients/PipelineClient.cs#L273

jhueppauff avatar Apr 04 '24 07:04 jhueppauff

Sorry for the late reply...

The name may indeed be a bit misleading. The method returns a GitLabCollectionResponse<Job> which, although it cannot be awaited, can be enumerated asynchronously:

var jobs = pipelineClient.GetJobsAsync(pipelineJobQuery);
await foreach (var job in jobs)
{
}

louis-z avatar Dec 20 '24 15:12 louis-z