GitHub

EventLogCompactionRpcs

API reference for EventLogCompactionRpcs.

The RPCs of encrypted remote compaction, served by the encrypted server next to EventLogRemoteRpcs; clients call them only when HelloResponse.compaction is set.

Attributes

AttributeTypeDescription
compaction_status= CompactionStatusRpc
compaction_begin= CompactionBeginRpc
compaction_input= CompactionInputRpc
compaction_fetch= CompactionFetchRpc
compaction_part= CompactionPartRpc
compaction_abort= CompactionAbortRpc
compaction_commit= CompactionCommitRpc

Functions

handlers

handlers() -> Handlers[Self, Never, Tags_contra]

No handlers yet: add one per RPC with handle.

Returns Handlers[Self, Never, Tags_contra]

@classmethod
def handlers(cls) -> Handlers[Self, Never, Tags_contra]:
    """No handlers yet: add one per RPC with ``handle``."""
    return Handlers(cls, {})

to_layer

to_layer[R](handlers) -> Layer[HandlersFor[Self], Never, R]

The layer of the group's handlers (Effect's toLayer). Each handler runs with the services of the layer's context. An RPC left without a handler is a pyright error when the group lists its tags (RpcGroup[Literal[...]]), and a ValueError here either way.

ParameterTypeDescription
handlersHandlers[Self, R, Never]

Returns Layer[HandlersFor[Self], Never, R]

@classmethod
def to_layer[R](
    cls, handlers: Handlers[Self, R, Never], /
) -> Layer[HandlersFor[Self], Never, R]:
    """The layer of the group's handlers (Effect's ``toLayer``). Each
    handler runs with the services of the layer's context. An RPC left
    without a handler is a pyright error when the group lists its tags
    (``RpcGroup[Literal[...]]``), and a ``ValueError`` here either way."""
    message = cls._missing_handlers(handlers)
    if message is not None:
        raise ValueError(message)
    return cls.to_layer_effect(succeed(handlers))

to_layer_effect

to_layer_effect[EX, RR = Never](handlers) -> Layer[HandlersFor[Self], EX, RR]

to_layer with the handlers made by an effect.

ParameterTypeDescription
handlersEffect[Handlers[Self, RR, Never], EX, RR]

Returns Layer[HandlersFor[Self], EX, RR]

@classmethod
def to_layer_effect[EX, RR = Never](
    cls, handlers: Effect[Handlers[Self, RR, Never], EX, RR], /
) -> Layer[HandlersFor[Self], EX, RR]:
    """``to_layer`` with the handlers made by an effect."""
    require_effect(handlers, "handlers")
    return layer_effect_context(handlers.flat_map(cls._handler_context))