Skip to content

,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

NameDescription
TResultThe type of the elements in the produced sequence.

Parameters

NameTypeDescription
provider[IQbservableProvider](#Query provider used to construct the [IQbservable](# data source.
subscribeExpression, IDisposable>>Implementation of the resulting observable sequence's Subscribe method.

Returns: IQbservable -- The observable sequence with the specified implementation for the Subscribe method.

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

TypeCondition
System.ArgumentNullExceptionsubscribe 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

NameDescription
TResultThe type of the elements in the produced sequence.

Parameters

NameTypeDescription
provider[IQbservableProvider](#Query provider used to construct the [IQbservable](# data source.
subscribeExpression, Action>>Implementation of the resulting observable sequence's Subscribe method, returning an Action delegate that will be wrapped in an IDisposable.

Returns: IQbservable -- The observable sequence with the specified implementation for the Subscribe method.

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

TypeCondition
System.ArgumentNullExceptionsubscribe 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

NameDescription
TResultThe type of the elements in the produced sequence.

Parameters

NameTypeDescription
provider[IQbservableProvider](#Query provider used to construct the [IQbservable](# data source.
subscribeAsyncExpression, CancellationToken, Task>>Asynchronous method used to produce elements.

Returns: IQbservable -- The observable sequence surfacing the elements produced by the asynchronous method.

Remarks

When a subscription to the resulting sequence is disposed, the CancellationToken that was fed to the asynchronous subscribe function will be signaled.

Exceptions

TypeCondition
System.ArgumentNullExceptionsubscribeAsync 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

NameDescription
TResultThe type of the elements in the produced sequence.

Parameters

NameTypeDescription
provider[IQbservableProvider](#Query provider used to construct the [IQbservable](# data source.
subscribeAsyncExpression, Task>>Asynchronous method used to produce elements.

Returns: IQbservable -- The observable sequence surfacing the elements produced by the asynchronous method.

Remarks

This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11.

Exceptions

TypeCondition
System.ArgumentNullExceptionsubscribeAsync 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

NameDescription
TResultThe type of the elements in the produced sequence.

Parameters

NameTypeDescription
provider[IQbservableProvider](#Query provider used to construct the [IQbservable](# data source.
subscribeAsyncExpression, CancellationToken, Task>>Asynchronous method used to implement the resulting sequence's Subscribe method.

Returns: IQbservable -- The observable sequence with the specified implementation for the Subscribe method.

Remarks

When a subscription to the resulting sequence is disposed, the CancellationToken that was fed to the asynchronous subscribe function will be signaled.

Exceptions

TypeCondition
System.ArgumentNullExceptionsubscribeAsync 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

NameDescription
TResultThe type of the elements in the produced sequence.

Parameters

NameTypeDescription
provider[IQbservableProvider](#Query provider used to construct the [IQbservable](# data source.
subscribeAsyncExpression, Task>>Asynchronous method used to implement the resulting sequence's Subscribe method.

Returns: IQbservable -- The observable sequence with the specified implementation for the Subscribe method.

Remarks

This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11.

Exceptions

TypeCondition
System.ArgumentNullExceptionsubscribeAsync 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

NameDescription
TResultThe type of the elements in the produced sequence.

Parameters

NameTypeDescription
provider[IQbservableProvider](#Query provider used to construct the [IQbservable](# data source.
subscribeAsyncExpression, CancellationToken, Task>>Asynchronous method used to implement the resulting sequence's Subscribe method, returning an Action delegate that will be wrapped in an IDisposable.

Returns: IQbservable -- The observable sequence with the specified implementation for the Subscribe method.

Remarks

When a subscription to the resulting sequence is disposed, the CancellationToken that was fed to the asynchronous subscribe function will be signaled.

Exceptions

TypeCondition
System.ArgumentNullExceptionsubscribeAsync 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

NameDescription
TResultThe type of the elements in the produced sequence.

Parameters

NameTypeDescription
provider[IQbservableProvider](#Query provider used to construct the [IQbservable](# data source.
subscribeAsyncExpression, Task>>Asynchronous method used to implement the resulting sequence's Subscribe method, returning an Action delegate that will be wrapped in an IDisposable.

Returns: IQbservable -- The observable sequence with the specified implementation for the Subscribe method.

Remarks

This operator is especially useful in conjunction with the asynchronous programming features introduced in C# 5.0 and Visual Basic 11.

Exceptions

TypeCondition
System.ArgumentNullExceptionsubscribeAsync is null.