Show / Hide Table of Contents

Class ClientPipeline

Represents an extensible pipeline used by clients that call cloud services to send and receive HTTP request and responses. Creators of ClientPipeline can modify how it process a PipelineMessage by adding PipelinePolicy instances at various points in the default pipeline.

Inheritance
System.Object
ClientPipeline
Namespace: System.Dynamic.ExpandoObject
Assembly: System.ClientModel.dll
Syntax
[System.Runtime.CompilerServices.Nullable(0)]
[System.Runtime.CompilerServices.NullableContext(1)]
public sealed class ClientPipeline

Methods

Create(ClientPipelineOptions)

Create an instance of a ClientPipeline from the provided ClientPipelineOptions.

Declaration
public static System.ClientModel.Primitives.ClientPipeline Create (System.ClientModel.Primitives.ClientPipelineOptions options = null);
Parameters
ClientPipelineOptions options

If provided, the ClientPipelineOptions to use to construct the ClientPipeline.

Returns
ClientPipeline

The created ClientPipeline instance.

Create(ClientPipelineOptions, ReadOnlySpan<PipelinePolicy>, ReadOnlySpan<PipelinePolicy>, ReadOnlySpan<PipelinePolicy>)

Create an instance of a ClientPipeline from the provided ClientPipelineOptions and PipelinePolicy collections.

Declaration
public static System.ClientModel.Primitives.ClientPipeline Create (System.ClientModel.Primitives.ClientPipelineOptions options, ReadOnlySpan<System.ClientModel.Primitives.PipelinePolicy> perCallPolicies, ReadOnlySpan<System.ClientModel.Primitives.PipelinePolicy> perTryPolicies, ReadOnlySpan<System.ClientModel.Primitives.PipelinePolicy> beforeTransportPolicies);
Parameters
ClientPipelineOptions options

The ClientPipelineOptions to use to construct the ClientPipeline.

System.ReadOnlySpan<PipelinePolicy> perCallPolicies

A collection of PipelinePolicy instances to add to the default pipeline before the pipeline's retry policy.

System.ReadOnlySpan<PipelinePolicy> perTryPolicies

A collection of PipelinePolicy instances to add to the default pipeline after the pipeline's retry policy.

System.ReadOnlySpan<PipelinePolicy> beforeTransportPolicies

A collection of PipelinePolicy instances to add to the default pipeline before the pipeline's transport.

Returns
ClientPipeline

The created ClientPipeline instance.

Remarks

Policies provided in options are intended to come from the end-user of a client who has passed the ClientPipelineOptions instance to the client's constructor. The client constructor implementation is intended to pass client-specific policies using the perCallPolicies, perTryPolicies, and beforeTransportPolicies parameters and should not modify the ClientPipelineOptions provided by the client user.

CreateMessage()

Creates a PipelineMessage that can be sent using this pipeline instance.

Declaration
public System.ClientModel.Primitives.PipelineMessage CreateMessage ();
Returns
PipelineMessage

The created PipelineMessage.

Send(PipelineMessage)

Send the provided PipelineMessage.

Declaration
public void Send (System.ClientModel.Primitives.PipelineMessage message);
Parameters
PipelineMessage message

The PipelineMessage to send.

Remarks

All necessary values on Request should be set prior to calling Send(PipelineMessage). After the method returns, Response will be populated with the details of the service response.

Exceptions
ClientResultException

Thrown if an error other than the service responding with an error response occurred while sending the HTTP request.

SendAsync(PipelineMessage)

Send the provided PipelineMessage.

Declaration
[System.Diagnostics.DebuggerStepThrough]
public System.Threading.Tasks.ValueTask SendAsync (System.ClientModel.Primitives.PipelineMessage message);
Parameters
PipelineMessage message

The PipelineMessage to send.

Returns
System.Threading.Tasks.ValueTask

Remarks

All necessary values on Request should be set prior to calling Send(PipelineMessage). After the method returns, Response will be populated with the details of the service response.

Exceptions
ClientResultException

Thrown if an error other than the service responding with an error response occurred while sending the HTTP request.

Back to top Azure SDK for .NET