aspnetcore/benchmarks/Microsoft.AspNetCore.Signal.../Shared/TestDuplexPipe.cs

27 lines
719 B
C#

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.IO.Pipelines;
namespace Microsoft.AspNetCore.SignalR.Microbenchmarks.Shared
{
public class TestDuplexPipe : IDuplexPipe
{
private readonly TestPipeReader _input;
public PipeReader Input => _input;
public PipeWriter Output { get; }
public TestDuplexPipe()
{
_input = new TestPipeReader();
Output = new TestPipeWriter();
}
public void AddReadResult(ReadResult readResult)
{
_input.ReadResults.Add(readResult);
}
}
}