Table of Contents

Class LauncherBase

Namespace
PuppeteerSharp
Assembly
PuppeteerSharp.dll

Represents a Base process and any associated temporary user data directory that have created by Puppeteer and therefore must be cleaned up when no longer needed.

public abstract class LauncherBase : IDisposable
Inheritance
LauncherBase
Implements
Derived

Constructors

LauncherBase(string, LaunchOptions)

Initializes a new instance of the LauncherBase class.

public LauncherBase(string executable, LaunchOptions options)

Parameters

executable string

Full path of executable.

options LaunchOptions

Options for launching Base.

Properties

EndPoint

Gets Base endpoint.

public string EndPoint { get; }

Property Value

string

HasExited

Indicates whether Base process has exited.

public bool HasExited { get; }

Property Value

bool

IsExiting

Indicates whether Base process is exiting.

public bool IsExiting { get; }

Property Value

bool

Process

Gets Base process details.

public Process Process { get; }

Property Value

Process

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

Disposes Base process and any temporary user directory.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

Indicates whether disposal was initiated by Dispose() operation.

EnsureExitAsync(TimeSpan?)

Asynchronously waits for graceful Base process exit within a given timeout period. Kills the Base process if it has not exited within this period.

public Task EnsureExitAsync(TimeSpan? timeout)

Parameters

timeout TimeSpan?

The maximum waiting time for a graceful process exit.

Returns

Task

Task which resolves when the process is exited or killed.

~LauncherBase()

Finalizes an instance of the LauncherBase class.

protected ~LauncherBase()

GetDefaultBuildIdAsync()

Default build.

public abstract Task<string> GetDefaultBuildIdAsync()

Returns

Task<string>

A tasks that resolves when the build is obtained.

KillAsync()

Asynchronously kills Base process.

public Task KillAsync()

Returns

Task

Task which resolves when the process is killed.

SetEnvVariables(IDictionary<string, string>, IDictionary<string, string>, IDictionary)

Set Env Variables.

protected static void SetEnvVariables(IDictionary<string, string> environment, IDictionary<string, string> customEnv, IDictionary realEnv)

Parameters

environment IDictionary<string, string>

The environment.

customEnv IDictionary<string, string>

The customEnv.

realEnv IDictionary

The realEnv.

StartAsync()

Asynchronously starts Base process.

public Task StartAsync()

Returns

Task

Task which resolves when after start process begins.

WaitForExitAsync(TimeSpan?)

Waits for Base process exit within a given timeout.

public Task<bool> WaitForExitAsync(TimeSpan? timeout)

Parameters

timeout TimeSpan?

The maximum wait period.

Returns

Task<bool>

true if Base process has exited within the given timeout, or false otherwise.