stop
Start from API_LEVEL
3.0
. Please refer to API_LEVEL.
Shutdown the specified backend service, called asynchronously, with the shutdown result returned via a callback function.
info
permission code: device:os.bg_service
Type
function stop(option: Option): Result
Parameters
Option
Property | Type | Required | DefaultValue | Description | API_LEVEL |
---|---|---|---|---|---|
file | string | Y | - | The App Service js file must be the one configured in the service module in app.json | 3.0 |
complete_func | (callbackOption: CallbackOption) => void | Y | - | Callback function for the completion of the backend service stop | 3.0 |
CallbackOption
Property | Type | Description | API_LEVEL |
---|---|---|---|
file | string | App service js file, same as stop incoming parameters | 3.0 |
result | boolean | App service stop result, true means success, false means failure | 3.0 |
Result
Type | Description |
---|---|
boolean | If 0 is returned, The App Service is closed successfully |
Example
import { stop } from '@zos/app-service'