diff --git a/versioned_docs/version-latest/04-standard-library/01-cloud/service.md b/versioned_docs/version-latest/04-standard-library/01-cloud/service.md index 9ff388450..651461d48 100644 --- a/versioned_docs/version-latest/04-standard-library/01-cloud/service.md +++ b/versioned_docs/version-latest/04-standard-library/01-cloud/service.md @@ -271,9 +271,9 @@ let ServiceProps = cloud.ServiceProps{ ... }; | **Name** | **Type** | **Description** | | --- | --- | --- | -| onStart | IServiceOnEventHandler | Handler to run with the service starts. | +| onStart | IServiceOnEventHandler | Handler to run when the service starts. | | autoStart | bool | Whether the service should start automatically. | -| onStop | IServiceOnEventHandler | Handler to run with the service stops. | +| onStop | IServiceOnEventHandler | Handler to run in order to stop the service. | --- @@ -285,7 +285,13 @@ onStart: IServiceOnEventHandler; - *Type:* IServiceOnEventHandler -Handler to run with the service starts. +Handler to run when the service starts. + +This is where you implement the initialization logic of +the service, start any activities asychronously. + +DO NOT BLOCK! This handler should return as quickly as possible. If you need to run a long +running process, start it asynchronously. --- @@ -300,6 +306,9 @@ autoStart: bool; Whether the service should start automatically. +If `false`, the service will need to be started +manually by calling the inflight `start()` method. + --- ##### `onStop`Optional @@ -311,7 +320,10 @@ onStop: IServiceOnEventHandler; - *Type:* IServiceOnEventHandler - *Default:* no special activity at shutdown -Handler to run with the service stops. +Handler to run in order to stop the service. + +This is where you implement the shutdown logic of +the service, stop any activities, and clean up any resources. ---