,System.IDisposable}})} ,System.Action}})} ,System.Threading.CancellationToken,System.Threading.Tasks.Task}})} ,System.Threading.Tasks.Task}})} ,System.Threading.CancellationToken,System.Threading.Tasks.Task{System.IDisposable}}})} ,System.Threading.Tasks.Task{System.IDisposable}}})} ,System.Threading.CancellationToken,System.Threading.Tasks.Task{System.Action}}})} ,System.Threading.Tasks.Task{System.Action}}})}
Qbservable.Create(IQbservableProvider, Expression, IDisposable>>) method¶
Defined in
Type: Qbservable
Namespace: System.Reactive.Linq
Assembly: System.Reactive.dll
Applies to
netstandard2.0
Overloads¶
- 1.
public static IQbservable<TResult> Create<TResult>(this IQbservableProvider provider, Expression<Func<IObserver<TResult>, IDisposable>> subscribe) - 2.
public static IQbservable<TResult> Create<TResult>(this IQbservableProvider provider, Expression<Func<IObserver<TResult>, Action>> subscribe) - 3.
public static IQbservable<TResult> Create<TResult>(this IQbservableProvider provider, Expression<Func<IObserver<TResult>, CancellationToken, Task>> subscribeAsync) - 4.
public static IQbservable<TResult> Create<TResult>(this IQbservableProvider provider, Expression<Func<IObserver<TResult>, Task>> subscribeAsync) - 5.
public static IQbservable<TResult> Create<TResult>(this IQbservableProvider provider, Expression<Func<IObserver<TResult>, CancellationToken, Task<IDisposable>>> subscribeAsync) - 6.
public static IQbservable<TResult> Create<TResult>(this IQbservableProvider provider, Expression<Func<IObserver<TResult>, Task<IDisposable>>> subscribeAsync) - 7.
public static IQbservable<TResult> Create<TResult>(this IQbservableProvider provider, Expression<Func<IObserver<TResult>, CancellationToken, Task<Action>>> subscribeAsync) - 8.
public static IQbservable<TResult> Create<TResult>(this IQbservableProvider provider, Expression<Func<IObserver<TResult>, Task<Action>>> subscribeAsync)
1. Overload¶
public static IQbservable<TResult> Create<TResult>(this IQbservableProvider provider, Expression<Func<IObserver<TResult>, IDisposable>> subscribe)
Summary: Creates an observable sequence from a specified Subscribe method implementation.
Type parameters
| Name | Description |
|---|---|
TResult | The type of the elements in the produced sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
provider | [IQbservableProvider](# | Query provider used to construct the [IQbservable](# data source. |
subscribe | Expression | Implementation of the resulting observable sequence's Subscribe method. |
Returns: IQbservable
Remarks
Use of this operator is preferred over manual implementation of the IObservable interface. In case you need a type implementing IObservable rather than an anonymous implementation, consider using the ObservableBase abstract base class.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | subscribe is null. |
2. Overload¶
public static IQbservable<TResult> Create<TResult>(this IQbservableProvider provider, Expression<Func<IObserver<TResult>, Action>> subscribe)
Summary: Creates an observable sequence from a specified Subscribe method implementation.
Type parameters
| Name | Description |
|---|---|
TResult | The type of the elements in the produced sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
provider | [IQbservableProvider](# | Query provider used to construct the [IQbservable](# data source. |
subscribe | Expression | Implementation of the resulting observable sequence's Subscribe method, returning an Action delegate that will be wrapped in an IDisposable. |
Returns: IQbservable
Remarks
Use of this operator is preferred over manual implementation of the IObservable interface. In case you need a type implementing IObservable rather than an anonymous implementation, consider using the ObservableBase abstract base class.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | subscribe is null. |
3. Overload¶
public static IQbservable<TResult> Create<TResult>(this IQbservableProvider provider, Expression<Func<IObserver<TResult>, CancellationToken, Task>> subscribeAsync)
Summary: Creates an observable sequence from a specified cancellable asynchronous Subscribe method. The CancellationToken passed to the asynchronous Subscribe method is tied to the returned disposable subscription, allowing best-effort cancellation.
Type parameters
| Name | Description |
|---|---|
TResult | The type of the elements in the produced sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
provider | [IQbservableProvider](# | Query provider used to construct the [IQbservable](# data source. |
subscribeAsync | Expression | Asynchronous method used to produce elements. |
Returns: IQbservable
Remarks
When a subscription to the resulting sequence is disposed, the CancellationToken that was fed to the asynchronous subscribe function will be signaled.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | subscribeAsync is null. |
4. Overload¶
public static IQbservable<TResult> Create<TResult>(this IQbservableProvider provider, Expression<Func<IObserver<TResult>, Task>> subscribeAsync)
Summary: Creates an observable sequence from a specified asynchronous Subscribe method.
Type parameters
| Name | Description |
|---|---|
TResult | The type of the elements in the produced sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
provider | [IQbservableProvider](# | Query provider used to construct the [IQbservable](# data source. |
subscribeAsync | Expression | Asynchronous method used to produce elements. |
Returns: IQbservable
Remarks
This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | subscribeAsync is null. |
5. Overload¶
public static IQbservable<TResult> Create<TResult>(this IQbservableProvider provider, Expression<Func<IObserver<TResult>, CancellationToken, Task<IDisposable>>> subscribeAsync)
Summary: Creates an observable sequence from a specified cancellable asynchronous Subscribe method. The CancellationToken passed to the asynchronous Subscribe method is tied to the returned disposable subscription, allowing best-effort cancellation.
Type parameters
| Name | Description |
|---|---|
TResult | The type of the elements in the produced sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
provider | [IQbservableProvider](# | Query provider used to construct the [IQbservable](# data source. |
subscribeAsync | Expression | Asynchronous method used to implement the resulting sequence's Subscribe method. |
Returns: IQbservable
Remarks
When a subscription to the resulting sequence is disposed, the CancellationToken that was fed to the asynchronous subscribe function will be signaled.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | subscribeAsync is null. |
6. Overload¶
public static IQbservable<TResult> Create<TResult>(this IQbservableProvider provider, Expression<Func<IObserver<TResult>, Task<IDisposable>>> subscribeAsync)
Summary: Creates an observable sequence from a specified asynchronous Subscribe method.
Type parameters
| Name | Description |
|---|---|
TResult | The type of the elements in the produced sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
provider | [IQbservableProvider](# | Query provider used to construct the [IQbservable](# data source. |
subscribeAsync | Expression | Asynchronous method used to implement the resulting sequence's Subscribe method. |
Returns: IQbservable
Remarks
This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | subscribeAsync is null. |
7. Overload¶
public static IQbservable<TResult> Create<TResult>(this IQbservableProvider provider, Expression<Func<IObserver<TResult>, CancellationToken, Task<Action>>> subscribeAsync)
Summary: Creates an observable sequence from a specified cancellable asynchronous Subscribe method. The CancellationToken passed to the asynchronous Subscribe method is tied to the returned disposable subscription, allowing best-effort cancellation.
Type parameters
| Name | Description |
|---|---|
TResult | The type of the elements in the produced sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
provider | [IQbservableProvider](# | Query provider used to construct the [IQbservable](# data source. |
subscribeAsync | Expression | Asynchronous method used to implement the resulting sequence's Subscribe method, returning an Action delegate that will be wrapped in an IDisposable. |
Returns: IQbservable
Remarks
When a subscription to the resulting sequence is disposed, the CancellationToken that was fed to the asynchronous subscribe function will be signaled.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | subscribeAsync is null. |
8. Overload¶
public static IQbservable<TResult> Create<TResult>(this IQbservableProvider provider, Expression<Func<IObserver<TResult>, Task<Action>>> subscribeAsync)
Summary: Creates an observable sequence from a specified asynchronous Subscribe method.
Type parameters
| Name | Description |
|---|---|
TResult | The type of the elements in the produced sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
provider | [IQbservableProvider](# | Query provider used to construct the [IQbservable](# data source. |
subscribeAsync | Expression | Asynchronous method used to implement the resulting sequence's Subscribe method, returning an Action delegate that will be wrapped in an IDisposable. |
Returns: IQbservable
Remarks
This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | subscribeAsync is null. |