# StreamSubscriptionHandleExtensions Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.streamsubscriptionhandleextensions/)

## ResumeAsync(StreamSubscriptionHandle&lt;T&gt;, Func&lt;IList&lt;SequentialItem&lt;T&gt;&gt;, Task&gt;, Func&lt;Exception, Task&gt;, Func&lt;Task&gt;, StreamSequenceToken) {#resumeasync-1-this-orleans-streams-streamsubscriptionhandle-t-system-func-system-12e4ef87}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.streamsubscriptionhandleextensions/methods/resumeasync-1-this-orleans-streams-streamsubscriptionhandle-t-system-func-system-12e4ef87/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/Extensions/StreamSubscriptionHandleExtensions.cs)

```csharp
public static Task<StreamSubscriptionHandle<T>> ResumeAsync<T>(this StreamSubscriptionHandle<T> handle, Func<IList<SequentialItem<T>>, Task> onNextAsync, Func<Exception, Task> onErrorAsync, Func<Task> onCompletedAsync, StreamSequenceToken token = null)
```

Resumes consumption of a stream using delegates. This method is a helper for the StreamSubscriptionHandle.ResumeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncBatchObserver.

### Parameters

- `handle` (`StreamSubscriptionHandle<T>`): The subscription handle.
- `onNextAsync` (`Func<IList<SequentialItem<T>>, Task>`): Delegate that is called for IAsyncObserver.OnNextAsync.
- `onErrorAsync` (`Func<Exception, Task>`): Delegate that is called for IAsyncObserver.OnErrorAsync.
- `onCompletedAsync` (`Func<Task>`): Delegate that is called for IAsyncObserver.OnCompletedAsync.
- `token` (`StreamSequenceToken`): The stream sequence to be used as an offset to start the subscription from.

### Returns

A promise for a StreamSubscriptionHandle that represents the subscription. The consumer may unsubscribe by using this handle. The subscription remains active for as long as it is not explicitly unsubscribed.

## ResumeAsync(StreamSubscriptionHandle&lt;T&gt;, Func&lt;IList&lt;SequentialItem&lt;T&gt;&gt;, Task&gt;, Func&lt;Exception, Task&gt;, StreamSequenceToken) {#resumeasync-1-this-orleans-streams-streamsubscriptionhandle-t-system-func-system-f42959c6}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.streamsubscriptionhandleextensions/methods/resumeasync-1-this-orleans-streams-streamsubscriptionhandle-t-system-func-system-f42959c6/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/Extensions/StreamSubscriptionHandleExtensions.cs)

```csharp
public static Task<StreamSubscriptionHandle<T>> ResumeAsync<T>(this StreamSubscriptionHandle<T> handle, Func<IList<SequentialItem<T>>, Task> onNextAsync, Func<Exception, Task> onErrorAsync, StreamSequenceToken token = null)
```

Resumes consumption of a stream using delegates. This method is a helper for the StreamSubscriptionHandle.ResumeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncBatchObserver.

### Parameters

- `handle` (`StreamSubscriptionHandle<T>`): The subscription handle.
- `onNextAsync` (`Func<IList<SequentialItem<T>>, Task>`): Delegate that is called for IAsyncObserver.OnNextAsync.
- `onErrorAsync` (`Func<Exception, Task>`): Delegate that is called for IAsyncObserver.OnErrorAsync.
- `token` (`StreamSequenceToken`): The stream sequence to be used as an offset to start the subscription from.

### Returns

A promise for a StreamSubscriptionHandle that represents the subscription. The consumer may unsubscribe by using this handle. The subscription remains active for as long as it is not explicitly unsubscribed.

## ResumeAsync(StreamSubscriptionHandle&lt;T&gt;, Func&lt;IList&lt;SequentialItem&lt;T&gt;&gt;, Task&gt;, Func&lt;Task&gt;, StreamSequenceToken) {#resumeasync-1-this-orleans-streams-streamsubscriptionhandle-t-system-func-system-d77b594c}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.streamsubscriptionhandleextensions/methods/resumeasync-1-this-orleans-streams-streamsubscriptionhandle-t-system-func-system-d77b594c/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/Extensions/StreamSubscriptionHandleExtensions.cs)

```csharp
public static Task<StreamSubscriptionHandle<T>> ResumeAsync<T>(this StreamSubscriptionHandle<T> handle, Func<IList<SequentialItem<T>>, Task> onNextAsync, Func<Task> onCompletedAsync, StreamSequenceToken token = null)
```

Resumes consumption of a stream using delegates. This method is a helper for the StreamSubscriptionHandle.ResumeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncBatchObserver.

### Parameters

- `handle` (`StreamSubscriptionHandle<T>`): The subscription handle.
- `onNextAsync` (`Func<IList<SequentialItem<T>>, Task>`): Delegate that is called for IAsyncObserver.OnNextAsync.
- `onCompletedAsync` (`Func<Task>`): Delegate that is called for IAsyncObserver.OnCompletedAsync.
- `token` (`StreamSequenceToken`): The stream sequence to be used as an offset to start the subscription from.

### Returns

A promise for a StreamSubscriptionHandle that represents the subscription. The consumer may unsubscribe by using this handle. The subscription remains active for as long as it is not explicitly unsubscribed.

## ResumeAsync(StreamSubscriptionHandle&lt;T&gt;, Func&lt;IList&lt;SequentialItem&lt;T&gt;&gt;, Task&gt;, StreamSequenceToken) {#resumeasync-1-this-orleans-streams-streamsubscriptionhandle-t-system-func-system-d5f482bf}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.streamsubscriptionhandleextensions/methods/resumeasync-1-this-orleans-streams-streamsubscriptionhandle-t-system-func-system-d5f482bf/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/Extensions/StreamSubscriptionHandleExtensions.cs)

```csharp
public static Task<StreamSubscriptionHandle<T>> ResumeAsync<T>(this StreamSubscriptionHandle<T> handle, Func<IList<SequentialItem<T>>, Task> onNextAsync, StreamSequenceToken token = null)
```

Thrown if the supplied stream filter function is not suitable. Usually this is because it is not a static method.

### Parameters

- `handle` (`StreamSubscriptionHandle<T>`): The subscription handle.
- `onNextAsync` (`Func<IList<SequentialItem<T>>, Task>`): Delegate that is called for IAsyncObserver.OnNextAsync.
- `token` (`StreamSequenceToken`): The stream sequence to be used as an offset to start the subscription from.

### Returns

A promise for a StreamSubscriptionHandle that represents the subscription. The consumer may unsubscribe by using this handle. The subscription remains active for as long as it is not explicitly unsubscribed.

## ResumeAsync(StreamSubscriptionHandle&lt;T&gt;, Func&lt;T, StreamSequenceToken, Task&gt;, Func&lt;Exception, Task&gt;, Func&lt;Task&gt;, StreamSequenceToken) {#resumeasync-1-this-orleans-streams-streamsubscriptionhandle-t-system-func-t-orle-f2179e86}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.streamsubscriptionhandleextensions/methods/resumeasync-1-this-orleans-streams-streamsubscriptionhandle-t-system-func-t-orle-f2179e86/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/Extensions/StreamSubscriptionHandleExtensions.cs)

```csharp
public static Task<StreamSubscriptionHandle<T>> ResumeAsync<T>(this StreamSubscriptionHandle<T> handle, Func<T, StreamSequenceToken, Task> onNextAsync, Func<Exception, Task> onErrorAsync, Func<Task> onCompletedAsync, StreamSequenceToken token = null)
```

Resumes consumption of a stream using delegates. This method is a helper for the StreamSubscriptionHandle.ResumeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver.

### Parameters

- `handle` (`StreamSubscriptionHandle<T>`): The subscription handle.
- `onNextAsync` (`Func<T, StreamSequenceToken, Task>`): Delegate that is called for IAsyncObserver.OnNextAsync.
- `onErrorAsync` (`Func<Exception, Task>`): Delegate that is called for IAsyncObserver.OnErrorAsync.
- `onCompletedAsync` (`Func<Task>`): Delegate that is called for IAsyncObserver.OnCompletedAsync.
- `token` (`StreamSequenceToken`): The stream sequence to be used as an offset to start the subscription from.

### Returns

A promise for a StreamSubscriptionHandle that represents the subscription. The consumer may unsubscribe by using this handle. The subscription remains active for as long as it is not explicitly unsubscribed.

## ResumeAsync(StreamSubscriptionHandle&lt;T&gt;, Func&lt;T, StreamSequenceToken, Task&gt;, Func&lt;Exception, Task&gt;, StreamSequenceToken) {#resumeasync-1-this-orleans-streams-streamsubscriptionhandle-t-system-func-t-orle-f848ca51}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.streamsubscriptionhandleextensions/methods/resumeasync-1-this-orleans-streams-streamsubscriptionhandle-t-system-func-t-orle-f848ca51/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/Extensions/StreamSubscriptionHandleExtensions.cs)

```csharp
public static Task<StreamSubscriptionHandle<T>> ResumeAsync<T>(this StreamSubscriptionHandle<T> handle, Func<T, StreamSequenceToken, Task> onNextAsync, Func<Exception, Task> onErrorAsync, StreamSequenceToken token = null)
```

Resumes consumption of a stream using delegates. This method is a helper for the StreamSubscriptionHandle.ResumeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver.

### Parameters

- `handle` (`StreamSubscriptionHandle<T>`): The subscription handle.
- `onNextAsync` (`Func<T, StreamSequenceToken, Task>`): Delegate that is called for IAsyncObserver.OnNextAsync.
- `onErrorAsync` (`Func<Exception, Task>`): Delegate that is called for IAsyncObserver.OnErrorAsync.
- `token` (`StreamSequenceToken`): The stream sequence to be used as an offset to start the subscription from.

### Returns

A promise for a StreamSubscriptionHandle that represents the subscription. The consumer may unsubscribe by using this handle. The subscription remains active for as long as it is not explicitly unsubscribed.

## ResumeAsync(StreamSubscriptionHandle&lt;T&gt;, Func&lt;T, StreamSequenceToken, Task&gt;, Func&lt;Task&gt;, StreamSequenceToken) {#resumeasync-1-this-orleans-streams-streamsubscriptionhandle-t-system-func-t-orle-48e1ebe9}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.streamsubscriptionhandleextensions/methods/resumeasync-1-this-orleans-streams-streamsubscriptionhandle-t-system-func-t-orle-48e1ebe9/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/Extensions/StreamSubscriptionHandleExtensions.cs)

```csharp
public static Task<StreamSubscriptionHandle<T>> ResumeAsync<T>(this StreamSubscriptionHandle<T> handle, Func<T, StreamSequenceToken, Task> onNextAsync, Func<Task> onCompletedAsync, StreamSequenceToken token = null)
```

Resumes consumption of a stream using delegates. This method is a helper for the StreamSubscriptionHandle.ResumeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver.

### Parameters

- `handle` (`StreamSubscriptionHandle<T>`): The subscription handle.
- `onNextAsync` (`Func<T, StreamSequenceToken, Task>`): Delegate that is called for IAsyncObserver.OnNextAsync.
- `onCompletedAsync` (`Func<Task>`): Delegate that is called for IAsyncObserver.OnCompletedAsync.
- `token` (`StreamSequenceToken`): The stream sequence to be used as an offset to start the subscription from.

### Returns

A promise for a StreamSubscriptionHandle that represents the subscription. The consumer may unsubscribe by using this handle. The subscription remains active for as long as it is not explicitly unsubscribed.

## ResumeAsync(StreamSubscriptionHandle&lt;T&gt;, Func&lt;T, StreamSequenceToken, Task&gt;, StreamSequenceToken) {#resumeasync-1-this-orleans-streams-streamsubscriptionhandle-t-system-func-t-orle-f0f3af60}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.streamsubscriptionhandleextensions/methods/resumeasync-1-this-orleans-streams-streamsubscriptionhandle-t-system-func-t-orle-f0f3af60/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Streaming/Extensions/StreamSubscriptionHandleExtensions.cs)

```csharp
public static Task<StreamSubscriptionHandle<T>> ResumeAsync<T>(this StreamSubscriptionHandle<T> handle, Func<T, StreamSequenceToken, Task> onNextAsync, StreamSequenceToken token = null)
```

Thrown if the supplied stream filter function is not suitable. Usually this is because it is not a static method.

### Parameters

- `handle` (`StreamSubscriptionHandle<T>`): The subscription handle.
- `onNextAsync` (`Func<T, StreamSequenceToken, Task>`): Delegate that is called for IAsyncObserver.OnNextAsync.
- `token` (`StreamSequenceToken`): The stream sequence to be used as an offset to start the subscription from.

### Returns

A promise for a StreamSubscriptionHandle that represents the subscription. The consumer may unsubscribe by using this handle. The subscription remains active for as long as it is not explicitly unsubscribed.
