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

Function serializeEnvelope

packages/effect/src/unstable/cluster/Message.ts:235–241  ·  view source on GitHub ↗
(
  message: Outgoing<Rpc>
)

Source from the content-addressed store, hash-verified

233 * @since 4.0.0
234 */
235export const serializeEnvelope = <Rpc extends Rpc.Any>(
236 message: Outgoing<Rpc>
237): Effect.Effect<Envelope.Encoded, MalformedMessage, never> =>
238 Effect.flatMap(
239 serialize(message),
240 (envelope) => MalformedMessage.refail(Schema.encodeEffect(Envelope.PartialJson)(envelope))
241 )
242
243/**
244 * Encodes the payload of an `OutgoingRequest` with the request's RPC payload

Callers

nothing calls this directly

Calls 2

refailMethod · 0.80
serializeFunction · 0.70

Tested by

no test coverage detected