GitHub

FlusherService

API reference for FlusherService.

flush drains every registered exporter at once; register adds an export until the current scope closes.

Attributes

AttributeTypeDescription
flushEffect[None]

Runs every registered export concurrently and waits for them; never fails. It skips exporters in their 60-second disabled window and waits only for the exports it starts; there is no built-in timeout, so bound it with timeout_option. A no-op when nothing is registered.

Functions

__init__

__init__(*, flush, register) -> None
ParameterTypeDescription
flushEffect[None]
registerCallable[[Effect[None]], Effect[None, Never, Scope]]
def __init__(
    self,
    *,
    flush: Effect[None],
    register: Callable[[Effect[None]], Effect[None, Never, Scope]],
) -> None:
    self._flush = flush
    self._register = register

register

register(run) -> Effect[None, Never, Scope]

Adds run (an exporter's export-now) to the registry until the current scope closes, when it is removed. Never fails.

ParameterTypeDescription
runEffect[None]

Returns Effect[None, Never, Scope]

def register(self, run: Effect[None]) -> Effect[None, Never, Scope]:
    """Adds ``run`` (an exporter's export-now) to the registry until
    the current scope closes, when it is removed. Never fails."""
    require_effect(run, "run")
    return self._register(run)