# IAsyncObservable&lt;T&gt; Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.iasyncobservable-1/)

## SubscribeAsync(IAsyncObserver&lt;T&gt;) {#subscribeasync-orleans-streams-iasyncobserver-t-4b4ec6fc}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.iasyncobservable-1/methods/subscribeasync-orleans-streams-iasyncobserver-t-4b4ec6fc/)

```csharp
public abstract Task<StreamSubscriptionHandle<T>> SubscribeAsync(IAsyncObserver<T> observer)
```

Subscribe a consumer to this observable.

### Parameters

- `observer` (`IAsyncObserver<T>`): The asynchronous observer to subscribe.

### 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.

## SubscribeAsync(IAsyncObserver&lt;T&gt;, StreamSequenceToken?, string?) {#subscribeasync-orleans-streams-iasyncobserver-t-orleans-streams-streamsequenceto-ab54d9fc}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.streaming/orleans.streams.iasyncobservable-1/methods/subscribeasync-orleans-streams-iasyncobserver-t-orleans-streams-streamsequenceto-ab54d9fc/)

```csharp
public abstract Task<StreamSubscriptionHandle<T>> SubscribeAsync(IAsyncObserver<T> observer, StreamSequenceToken? token, string? filterData = null)
```

Subscribe a consumer to this observable.

### Parameters

- `observer` (`IAsyncObserver<T>`): The asynchronous observer to subscribe.
- `token` (`StreamSequenceToken?`): The stream sequence to be used as an offset to start the subscription from.
- `filterData` (`string?`): Data object that will be passed in to the filter.

### 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.
