/// <summary> /// Defines a parameterized stream factory identified by the specified URI. /// </summary> /// <typeparam name="TArgs">Type of the parameter passed to the stream factory.</typeparam> /// <typeparam name="TInput">Type of the data received by the subjects created by the stream factory.</typeparam> /// <typeparam name="TOutput">Type of the data produced by the subjects created by the stream factory.</typeparam> /// <param name="uri">URI identifying the stream factory.</param> /// <param name="streamFactory">Stream factory to be defined.</param> /// <param name="state">Additional metadata to associate with the artifact. Implementations can interpret this value, or ignore it.</param> /// <param name="token">Token to observe for cancellation of the request.</param> /// <returns>Task to await the completion of the stream factory definition.</returns> public Task DefineStreamFactoryAsync <TArgs, TInput, TOutput>(Uri uri, IAsyncReactiveQubjectFactory <TInput, TOutput, TArgs> streamFactory, object state = null, CancellationToken token = default) { if (uri == null) { throw new ArgumentNullException(nameof(uri)); } if (streamFactory == null) { throw new ArgumentNullException(nameof(streamFactory)); } return(DefineStreamFactoryAsyncCore <TArgs, TInput, TOutput>(uri, streamFactory, state, token)); }
internal Task <IAsyncReactiveQubject <TInput, TOutput> > CreateStreamAsync <TArgs, TInput, TOutput>(IAsyncReactiveQubjectFactory <TInput, TOutput, TArgs> factory, TArgs argument, Uri streamUri, object state, CancellationToken token) { return(CreateStreamAsync <TInput, TOutput>(factory, new Expression[] { Expression.Constant(argument, typeof(TArgs)) }, streamUri, state, token)); }
internal Task <IAsyncReactiveQubject <TInput, TOutput> > CreateStreamAsync <TInput, TOutput>(IAsyncReactiveQubjectFactory <TInput, TOutput> factory, Uri streamUri, object state, CancellationToken token) { return(CreateStreamAsync <TInput, TOutput>(factory, Array.Empty <Expression>(), streamUri, state, token)); }
/// <summary> /// Defines a parameterized stream factory identified by the specified URI. /// </summary> /// <typeparam name="TArgs">Type of the parameter passed to the stream factory.</typeparam> /// <typeparam name="TInput">Type of the data received by the subjects created by the stream factory.</typeparam> /// <typeparam name="TOutput">Type of the data produced by the subjects created by the stream factory.</typeparam> /// <param name="uri">URI identifying the stream factory.</param> /// <param name="streamFactory">Stream factory to be defined.</param> /// <param name="state">Additional metadata to associate with the artifact. Implementations can interpret this value, or ignore it.</param> /// <param name="token">Token to observe for cancellation of the request.</param> /// <returns>Task to await the completion of the stream factory definition.</returns> protected override Task DefineStreamFactoryAsyncCore <TArgs, TInput, TOutput>(Uri uri, IAsyncReactiveQubjectFactory <TInput, TOutput, TArgs> streamFactory, object state = null, CancellationToken token = default) { var expression = _expressionServices.Normalize(streamFactory.Expression); return(_provider.DefineStreamFactoryAsync(uri, expression, state, token)); }
/// <summary> /// Defines a parameterized stream factory identified by the specified URI. /// </summary> /// <typeparam name="TArgs">Type of the parameter passed to the stream factory.</typeparam> /// <typeparam name="TInput">Type of the data received by the subjects created by the stream factory.</typeparam> /// <typeparam name="TOutput">Type of the data produced by the subjects created by the stream factory.</typeparam> /// <param name="uri">URI identifying the stream factory.</param> /// <param name="streamFactory">Stream factory to be defined.</param> /// <param name="state">Additional metadata to associate with the artifact. Implementations can interpret this value, or ignore it.</param> /// <param name="token">Token to observe for cancellation of the request.</param> /// <returns>Task to await the completion of the stream factory definition.</returns> public Task DefineStreamFactoryAsync <TArgs, TInput, TOutput>(Uri uri, IAsyncReactiveQubjectFactory <TInput, TOutput, TArgs> streamFactory, object state = null, CancellationToken token = default) => Definition.DefineStreamFactoryAsync(uri, streamFactory, state, token);
/// <summary> /// Defines a parameterized stream factory identified by the specified URI. /// </summary> /// <typeparam name="TArgs">Type of the parameter passed to the stream factory.</typeparam> /// <typeparam name="TInput">Type of the data received by the subjects created by the stream factory.</typeparam> /// <typeparam name="TOutput">Type of the data produced by the subjects created by the stream factory.</typeparam> /// <param name="uri">URI identifying the stream factory.</param> /// <param name="streamFactory">Stream factory to be defined.</param> /// <param name="state">Additional metadata to associate with the artifact. Implementations can interpret this value, or ignore it.</param> /// <param name="token">Token to observe for cancellation of the request.</param> /// <returns>Task to await the completion of the stream factory definition.</returns> protected abstract Task DefineStreamFactoryAsyncCore <TArgs, TInput, TOutput>(Uri uri, IAsyncReactiveQubjectFactory <TInput, TOutput, TArgs> streamFactory, object state = null, CancellationToken token = default);