MCPcopy Create free account
hub / github.com/Effect-TS/effect / withLogAddress

Function withLogAddress

packages/effect/src/unstable/cluster/SocketRunner.ts:25–35  ·  view source on GitHub ↗
(layer: Layer.Layer<A, E, R>)

Source from the content-addressed store, hash-verified

23import type { ShardingConfig } from "./ShardingConfig.ts"
24
25const withLogAddress = <A, E, R>(layer: Layer.Layer<A, E, R>): Layer.Layer<A, E, R | SocketServer> =>
26 Layer.effectDiscard(Effect.gen(function*() {
27 const server = yield* SocketServer
28 const address = server.address._tag === "UnixAddress"
29 ? server.address.path
30 : `${server.address.hostname}:${server.address.port}`
31 yield* Effect.annotateLogs(Effect.logInfo(`Listening on: ${address}`), {
32 package: "@effect/cluster",
33 service: "Runner"
34 })
35 })).pipe(Layer.provideMerge(layer))
36
37/**
38 * Layer that runs a cluster runner over the socket RPC protocol, providing

Callers

nothing calls this directly

Calls 1

pipeMethod · 0.65

Tested by

no test coverage detected