# IEventHubReceiver Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.streaming.eventhubs/orleans.streaming.eventhubs.ieventhubreceiver/)

## CloseAsync {#closeasync-d2676df3}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming.eventhubs/orleans.streaming.eventhubs.ieventhubreceiver/methods/closeasync-d2676df3/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Azure/Orleans.Streaming.EventHubs/Providers/Streams/EventHub/IEventHubReceiver.cs#L37)

```csharp
public abstract Task CloseAsync()
```

Send a clean up message

## CloseAsync(CancellationToken) {#closeasync-system-threading-cancellationtoken-1a0d9328}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming.eventhubs/orleans.streaming.eventhubs.ieventhubreceiver/methods/closeasync-system-threading-cancellationtoken-1a0d9328/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Azure/Orleans.Streaming.EventHubs/Providers/Streams/EventHub/IEventHubReceiver.cs#L37)

```csharp
public virtual Task CloseAsync(CancellationToken cancellationToken)
```

Sends a cleanup message which can be canceled.

### Parameters

- `cancellationToken` (`CancellationToken`): The token used to cancel the operation.

### Returns

A task representing the operation.

## ReceiveAsync(int, TimeSpan) {#receiveasync-int-system-timespan-50a3987c}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming.eventhubs/orleans.streaming.eventhubs.ieventhubreceiver/methods/receiveasync-int-system-timespan-50a3987c/)

```csharp
public abstract Task<IEnumerable<EventData>> ReceiveAsync(int maxCount, TimeSpan waitTime)
```

Send an async message to the partition asking for more messages

### Parameters

- `maxCount` (`int`): Max amount of message which should be delivered in this request
- `waitTime` (`TimeSpan`): Wait time of this request
