Skip to content

)} ,System.Reactive.Concurrency.IScheduler)}

Observable.Start(Func) method

Defined in

Type: Observable Namespace: System.Reactive.Linq Assembly: System.Reactive.dll

Applies to

netstandard2.0

Overloads

  • 1. public static IObservable<TResult> Start<TResult>(Func<TResult> function)
  • 2. public static IObservable<TResult> Start<TResult>(Func<TResult> function, IScheduler scheduler)
  • 3. public static IObservable<Unit> Start(Action action)
  • 4. public static IObservable<Unit> Start(Action action, IScheduler scheduler)

1. Overload

public static IObservable<TResult> Start<TResult>(Func<TResult> function)

Summary: Invokes the specified function asynchronously, surfacing the result through an observable sequence.

Type parameters

NameDescription
TResultThe type of the result returned by the function.

Parameters

NameTypeDescription
functionFuncFunction to run asynchronously.

Returns: IObservable -- An observable sequence exposing the function's result value, or an exception.

Remarks

  • The function is called immediately, not during the subscription of the resulting sequence.
  • Multiple subscriptions to the resulting sequence can observe the function's result.

Exceptions

TypeCondition
System.ArgumentNullExceptionfunction is null.

2. Overload

public static IObservable<TResult> Start<TResult>(Func<TResult> function, IScheduler scheduler)

Summary: Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence

Type parameters

NameDescription
TResultThe type of the result returned by the function.

Parameters

NameTypeDescription
functionFuncFunction to run asynchronously.
scheduler[IScheduler](#Scheduler to run the function on.

Returns: IObservable -- An observable sequence exposing the function's result value, or an exception.

Remarks

  • The function is called immediately, not during the subscription of the resulting sequence.
  • Multiple subscriptions to the resulting sequence can observe the function's result.

Exceptions

TypeCondition
System.ArgumentNullExceptionfunction or scheduler is null.

3. Overload

public static IObservable<Unit> Start(Action action)

Summary: Invokes the action asynchronously, surfacing the result through an observable sequence.

Parameters

NameTypeDescription
actionActionAction to run asynchronously.

Returns: IObservable -- An observable sequence exposing a Unit value upon completion of the action, or an exception.

Remarks

  • The action is called immediately, not during the subscription of the resulting sequence.
  • Multiple subscriptions to the resulting sequence can observe the action's outcome.

Exceptions

TypeCondition
System.ArgumentNullExceptionaction is null.

4. Overload

public static IObservable<Unit> Start(Action action, IScheduler scheduler)

Summary: Invokes the action asynchronously on the specified scheduler, surfacing the result through an observable sequence.

Parameters

NameTypeDescription
actionActionAction to run asynchronously.
scheduler[IScheduler](#Scheduler to run the action on.

Returns: IObservable -- An observable sequence exposing a Unit value upon completion of the action, or an exception.

Remarks

  • The action is called immediately, not during the subscription of the resulting sequence.
  • Multiple subscriptions to the resulting sequence can observe the action's outcome.

Exceptions

TypeCondition
System.ArgumentNullExceptionaction or scheduler is null.