Search Results for

    Show / Hide Table of Contents

    Overview

    Thresh is a low-level infrastructure library for League Client API integration.

    It provides composable transport, discovery, and event primitives. It does not provide high-level application orchestration.

    Core API surfaces

    Thresh exposes two primary abstractions designed to work together:

    1. ILcuHttpClient for resilient HTTP interactions
    2. IEventStream for real-time WAMP events (OnJsonApiEvent)

    Package map

    • Thresh.Extensions — DI registration and core runtime composition
    • Thresh.Endpoints — optional typed endpoint groups over ILcuHttpClient
    • Thresh.Hosting — hosting/lifecycle integration for background processes
    • Thresh.HealthChecks — health check integration
    • Thresh.Reactive — optional reactive wrappers around event streams

    Start with Thresh.Extensions, then add optional packages only where needed.

    Architecture at a glance

    • Public abstractions: Thresh.Abstractions
    • Runtime implementation: Thresh.Core
    • DI integration: Thresh.Extensions

    This separation keeps business logic independent from transport internals and improves testability.

    Design principles

    • async-first APIs with CancellationToken support
    • DI-first composition
    • resilience defaults via Polly v8 retry and circuit-breaker strategies
    • observability hooks via ILogger, Meter, and ActivitySource("Thresh")
    • strict local trust model for authenticated LCU communication

    Event model

    IEventStream manages connection lifecycle and reconnection, and emits:

    • RawMessage for raw WAMP payloads
    • Message for parsed LeagueEventEnvelope values
    • Reconnected when a connection is re-established

    Subscriptions are available by:

    • exact URI (Subscribe(string uri, ...))
    • regex pattern (Subscribe(Regex pattern, ...))
    • typed payload (Subscribe<T>(..., withSnapshot: true|false))

    Platform and discovery model

    • Official support targets Windows and macOS.
    • Other environments (including Linux/Wine/Proton variants) are best-effort.
    • Use LCU_LOCKFILE explicitly for non-standard layouts.

    Lockfile resolution is deterministic:

    1. LCU_LOCKFILE override
    2. cached lockfile path (if valid)
    3. process-derived candidates
    4. known install paths per platform

    Boundary reminder

    Thresh stays intentionally focused on reliable primitives.

    Higher-level workflows, state machines, and domain orchestration should live in consumer code or optional packages.

    • Edit this page
    In this article
    Back to top Generated by DocFX