From 0ee969c1cd613db115d26f847610b9f0f9df6d1a Mon Sep 17 00:00:00 2001
From: wingbot <109207340+monadabot@users.noreply.github.com>
Date: Tue, 26 Sep 2023 14:11:29 +0300
Subject: [PATCH] feat(docs): update docs (#624)
feat(docs): update docs
Updates the Wing docs. See details in [workflow run].
[Workflow Run]: https://github.com/winglang/docsite/actions/runs/6311780440
------
*Automatically created via the "update-docs" workflow*
---
.../04-standard-library/01-cloud/service.md | 20 +++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
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.
---