confluent-kafka-dotnet
Show / Hide Table of Contents

Interface ISerdeDisposable

EXPERIMENTAL: subject to change or removal.

Implemented by serializers and deserializers that hold disposable resources they created themselves, and are therefore responsible for releasing.

A serializer or deserializer constructed by a producer or consumer from an ISerializerBuilder<T> (or one of its siblings) is owned by that client, and is released when the client is disposed. One that was constructed by the application and supplied directly remains owned by the application and is never released by the client.

This interface intentionally does not extend IDisposable: doing so would cause analyzers to require disposal at every construction site in application code, which is misleading given that a serializer holding no resources of its own has nothing to release. Use the DisposeOwnedResources extension methods to release an arbitrary serializer or deserializer.

Namespace: Confluent.Kafka
Assembly: Confluent.Kafka.dll
Syntax
public interface ISerdeDisposable

Methods

DisposeOwnedResources()

Release the resources this instance created itself.

Resources supplied by the application are not released. Implementations must tolerate being called more than once.

Declaration
void DisposeOwnedResources()
In this article