Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 2 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 30 additions & 7 deletions src/commands/pickFuncProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,40 @@ import { getWorkspaceSetting } from '../vsCodeConfig/settings';
const funcTaskReadyEmitter = new vscode.EventEmitter<vscode.WorkspaceFolder>();
export const onDotnetFuncTaskReady = funcTaskReadyEmitter.event;

/**
* Result returned from starting a function host process via the API.
*/
export interface IStartFuncProcessResult {
/**
* The process ID of the started function host.
*/
processId: string;
/**
* Whether the function host was successfully started.
*/
success: boolean;
/**
* Error message if the function host failed to start.
*/
error: string;
/**
* An async iterable stream of terminal output from the function host task.
* This stream provides real-time access to the output of the `func host start` command,
* allowing consumers to monitor host status, capture logs, and detect errors.
*
* The stream will be undefined if the host failed to start or if output streaming is not available.
* Consumers should iterate over the stream asynchronously to read output lines as they are produced.
* The stream remains active for the lifetime of the function host process.
*/
stream: AsyncIterable<string> | undefined;
}

export async function startFuncProcessFromApi(
buildPath: string,
args: string[],
env: { [key: string]: string }
): Promise<{ processId: string; success: boolean; error: string, stream: AsyncIterable<string> | undefined }> {
const result: {
processId: string;
success: boolean;
error: string;
stream: AsyncIterable<string> | undefined;
} = {
): Promise<IStartFuncProcessResult> {
const result: IStartFuncProcessResult = {
processId: '',
success: false,
error: '',
Expand Down