# Google.Cloud.Diagnostics.Common - Interface IConsumer&lt;T&gt; (5.3.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [5.3.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.IConsumer-1)
- [5.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.2.0/Google.Cloud.Diagnostics.Common.IConsumer-1)
- [5.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.1.0/Google.Cloud.Diagnostics.Common.IConsumer-1)
- [5.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.0.0/Google.Cloud.Diagnostics.Common.IConsumer-1)
- [4.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/4.4.0/Google.Cloud.Diagnostics.Common.IConsumer-1)
- [4.3.1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/4.3.1/Google.Cloud.Diagnostics.Common.IConsumer-1)

    public interface IConsumer<T> : IDisposable

Reference documentation and code samples for the Google.Cloud.Diagnostics.Common interface IConsumer

<br />

A consumer.

## Inherited Members

[IDisposable.Dispose()](https://learn.microsoft.com/dotnet/api/system.idisposable.dispose)

## Namespace

[Google.Cloud.Diagnostics.Common](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common)

## Assembly

Google.Cloud.Diagnostics.Common.dll

| ## Type Parameter ||
|---|---|
| **Name** | **Description** |
| `T` |   |

## Methods

### Receive(IEnumerable\<T\>)

    void Receive(IEnumerable<T> items)

Accepts an enumerable of items.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `items` | `https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1` The items to receive. Must not be null. |

### ReceiveAsync(IEnumerable\<T\>, CancellationToken)

    Task ReceiveAsync(IEnumerable<T> items, CancellationToken cancellationToken = default)

Accepts an enumerable of items asynchronously.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `items` | `https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1` The items to receive. Must not be null. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` The token to monitor for cancellation requests. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A task representing the asynchronous operation. |