refactor(client): rename service start to ensure
This commit is contained in:
parent
75bc611ef1
commit
ec8ee60e0b
17 changed files with 79 additions and 64 deletions
4
packages/www/content/docs/build/client.mdx
vendored
4
packages/www/content/docs/build/client.mdx
vendored
|
|
@ -113,7 +113,7 @@ Node application:
|
|||
|
||||
- `Service.discover()` returns a healthy registered endpoint without starting
|
||||
a process.
|
||||
- `Service.start()` reuses a compatible service or starts one when needed.
|
||||
- `Service.ensure()` returns a compatible service, starting one when needed.
|
||||
- `Service.stop()` stops the registered service.
|
||||
- `Service.headers(endpoint)` creates the authentication headers for a client.
|
||||
|
||||
|
|
@ -129,7 +129,7 @@ import { Effect } from "effect"
|
|||
import { FetchHttpClient } from "effect/unstable/http"
|
||||
|
||||
const program = Effect.gen(function* () {
|
||||
const endpoint = yield* Service.start()
|
||||
const endpoint = yield* Service.ensure()
|
||||
const client = yield* OpenCode.make({
|
||||
baseUrl: endpoint.url,
|
||||
headers: Service.headers(endpoint),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue