Table of Contents

Class SenderExtensions

Namespace
Mediarion
Assembly
Mediarion.Streaming.dll

Streaming, reached through the sender the application already has.

public static class SenderExtensions
Inheritance
SenderExtensions
Inherited Members

Remarks

In the library this one is a drop-in for, CreateStream is a method on ISender. It cannot be one here, because ISender lives in a package that has no dependencies and this one needs IAsyncEnumerable. An extension method makes the call site identical anyway: sender.CreateStream(request) compiles the same either way.

What it does not survive is a test double. Mocking ISender.CreateStream works over there and cannot work here, because a mocking library cannot intercept an extension method. Take IStreamSender in the code under test and mock that instead.

Methods

CreateStream(ISender, object, CancellationToken)

Sends a streaming request whose type is only known at run time.

CreateStream<TResponse>(ISender, IStreamRequest<TResponse>, CancellationToken)

Sends a streaming request.