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

Function layerInitialMessage

packages/effect/src/unstable/rpc/RpcWorker.ts:92–102  ·  view source on GitHub ↗
(
  schema: S,
  build: Effect.Effect<S["Type"], never, R2>
)

Source from the content-addressed store, hash-verified

90 * @since 4.0.0
91 */
92export const layerInitialMessage = <S extends Schema.Constraint, R2>(
93 schema: S,
94 build: Effect.Effect<S["Type"], never, R2>
95): Layer.Layer<InitialMessage, never, S["EncodingServices"] | R2> =>
96 Layer.effect(InitialMessage)(
97 Effect.contextWith((context: Context.Context<S["EncodingServices"] | R2>) =>
98 Effect.succeed(
99 Effect.provideContext(Effect.orDie(makeInitialMessage(schema, build)), context)
100 )
101 )
102 )
103
104/**
105 * Reads the protocol initial message and decodes it with the supplied schema,

Callers

nothing calls this directly

Calls 2

makeInitialMessageFunction · 0.85
succeedMethod · 0.45

Tested by

no test coverage detected