Skip to content

Applies to

net11.0, net10.0, net471, net47, net472, net481, net48

public static IObservable<(HubConnection HubConnection, MultipleDisposable Disposables)> Create(Func<HubConnectionBuilder, IHubConnectionBuilder> hubConnectionBuilder)

View source

Summary: Builds a new HubConnection for each subscription and disposes it when that subscription ends.

Parameters

NameTypeDescription
hubConnectionBuilderFuncConfigures the builder, for example with the hub URL; its result is built once per subscription.

Returns: IObservable<(HubConnection HubConnection, MultipleDisposable Disposables)> -- An observable that emits one value: the built, unstarted connection and a disposable group. Add the subscriptions made on the connection to the group so they end with it.

Exceptions

TypeCondition
System.ArgumentNullExceptionhubConnectionBuilder is null.