effect-rpc
    Preparing search index...

    Type Alias RPCHandlerConfig<R>

    Configuration object for the RPC handler. This is used to provide the service layers, serialization, and additional layers.

    0.3.0

    type RPCHandlerConfig<R> = {
        additionalLayers?: Layer.Layer<any, any, never>[];
        serialization?: SerializationLayer;
        serviceLayers: Layer.Layer<R>;
    }

    Type Parameters

    • R

      The type of the environment required by the handlers.

    Index

    Properties

    additionalLayers?: Layer.Layer<any, any, never>[]

    Additional Layer instances to merge into the environment. This can be used to provide additional dependencies required by the handlers, such as authentication middleware or other services. This is optional and can be omitted or an empty array if no additional layers are needed.

    serialization?: SerializationLayer

    The serialization layer to use for RPC communication. Defaults to RpcSerialization.layerNdjson. Must be of type SerializationLayer. If you use a custom serialization layer, make sure it is compatible with the RPC server you are communicating with. This means, you most likely want to modify the createEffectRPC function invocation to use the same serialization layer!

    serviceLayers: Layer.Layer<R>

    The Layer providing all dependencies required by the handlers (e.g., service implementations). This is typically the default service layer for the service being used.