request/src/request.tests/_fixtures/ConstrainedStreamHandler.cs

14 lines
512 B
C#
Raw Normal View History

// Copyright (c) The Geekeey Authors
// SPDX-License-Identifier: EUPL-1.2
namespace Geekeey.Request.Tests;
public class ConstrainedStreamHandler<TRequest> : IStreamRequestHandler<TRequest, string>
where TRequest : ConstrainedStreamRequest
{
public async IAsyncEnumerable<string> HandleAsync(TRequest request, [System.Runtime.CompilerServices.EnumeratorCancellation] CancellationToken cancellationToken)
{
yield return $"{request.Value}-Constrained-0";
yield return $"{request.Value}-Constrained-1";
}
}