BackgroundService
@thotnr-aws-accl/custom-app-api / Exports / BackgroundService
Class: BackgroundService
BackgroundService class provides methods to manage background services.
Table of contents
Methods
Methods
forceShutdownBackgroundService
▸ Static forceShutdownBackgroundService(backgroundServiceId): Promise<unknown>
Forcefully shuts down a background service identified by its ID. This terminates the host as well on which the background service is running before marking the service as shut down.
Parameters
backgroundServiceId
number | { backgroundServiceId: number }
The ID of the background service to shut down, either as a number or an object containing the ID.
Returns
Promise<unknown>
A promise that resolves when the service is successfully shut down or rejects with an error if the operation fails.
getAllBackgroundServicesStartable
▸ Static getAllBackgroundServicesStartable(): Promise<BackgroundServiceModel[]>
Retrieves all startable background services.
Returns
Promise<BackgroundServiceModel[]>
A promise that resolves to an array of BackgroundServiceModel.
getAllCurrentBackgroundServices
▸ Static getAllCurrentBackgroundServices(): Promise<BackgroundServiceModel[]>
Retrieves all current background services.
Returns
Promise<BackgroundServiceModel[]>
A promise that resolves to an array of BackgroundServiceModel.
getBackgroundServiceById
▸ Static getBackgroundServiceById(id): Promise<BackgroundServiceModel>
Retrieves a background service by its ID.
Parameters
id
number | { backgroundServiceId: number }
The ID of the background service to retrieve.
Returns
Promise<BackgroundServiceModel>
A promise that resolves to a BackgroundServiceModel.
getBackgroundServiceHostStatusById
▸ Static getBackgroundServiceHostStatusById(backgroundServiceParams): Promise<BackgroundServiceHost>
Retrieves the status of a background service host by the background service ID.
Parameters
backgroundServiceParams
BackgroundServiceParams
The parameters of the background service.
Returns
Promise<BackgroundServiceHost>
A promise that resolves to the status of the background service host.
getBackgroundServiceUpdatedStatusById
▸ Static getBackgroundServiceUpdatedStatusById(backgroundServiceParams): Promise<void>
Updates the status of a background service by its ID and label, then executes callbacks based on the result.
Parameters
backgroundServiceParams
BackgroundServiceParams
The parameters of the background service.
Returns
Promise<void>
A promise that resolves to void.
getBackgroundServicesByLabel
▸ Static getBackgroundServicesByLabel(label): Promise<BackgroundServiceModel[]>
Retrieves background services by their label.
Parameters
label
string
The label of the background services to retrieve.
Returns
Promise<BackgroundServiceModel[]>
A promise that resolves to an array of BackgroundServiceModel.
shutdownBackgroundService
▸ Static shutdownBackgroundService(backgroundServiceParams): Promise<void>
Shuts down a background service by its ID and label, then executes callbacks based on the result.
Parameters
backgroundServiceParams
BackgroundServiceParams
The parameters of the background service.
Returns
Promise<void>
A promise that resolves to void.
startNewBackgroundServiceOrReturnExisting
▸ Static startNewBackgroundServiceOrReturnExisting(label): Promise<SparkWebLauncherHost>
Starts a new background service or returns an existing one based on the provided label.
Parameters
label
string | { label: string }
The label of the background service.
Returns
Promise<SparkWebLauncherHost>
A promise that resolves to a SparkWebLauncherHost object.
Last updated