Table of Contents

Class CompressorPipelineExtensions

Namespace
IceRpc
Assembly
IceRpc.Compressor.dll

Provides an extension method for Pipeline to add the compressor interceptor.

public static class CompressorPipelineExtensions
Inheritance
CompressorPipelineExtensions
Inherited Members

Methods

UseCompressor(Pipeline, CompressionFormat, CompressionLevel)

Adds a CompressorInterceptor to this pipeline.

public static Pipeline UseCompressor(this Pipeline pipeline, CompressionFormat compressionFormat, CompressionLevel compressionLevel = CompressionLevel.Fastest)

Parameters

pipeline Pipeline

The pipeline being configured.

compressionFormat CompressionFormat

The compression format for the compress operation.

compressionLevel CompressionLevel

The compression level for the compress operation.

Returns

Pipeline

The pipeline being configured.

Examples

The following code adds the compressor interceptor to the invocation pipeline.

// Create a connection.
await using var connection = new ClientConnection(new Uri("icerpc://localhost"));

// Create an invocation pipeline and install the compressor interceptor.
Pipeline pipeline = new Pipeline()
    .UseCompressor(CompressionFormat.Brotli)
    .Into(connection);
See Also