Pipeline.InvokeAsync Pipeline.InvokeAsync Pipeline.InvokeAsync Method


Invoke the pipeline asynchronously

public abstract void InvokeAsync ();
abstract member InvokeAsync : unit -> unit
Public MustOverride Sub InvokeAsync ()

1) A pipeline is already executing. Pipeline cannot execute concurrently. 2) InvokeAsync is called on nested pipeline. Nested pipeline cannot be executed Asynchronously.


1) Results are returned through the Output reader. 2) When pipeline is invoked using InvokeAsync, invocation doesn't finish until Input to pipeline is closed. Caller of InvokeAsync must close the input pipe after all input has been written to input pipe. Input pipe is closed by calling Pipeline.Input.Close();

If you want this pipeline to execute as a standalone command (that is, using command-line parameters only), be sure to call Pipeline.Input.Close() before calling InvokeAsync(). Otherwise, the command will be executed as though it had external input. If you observe that the command isn't doing anything, this may be the reason.

Applies to