Search Results for

    Show / Hide Table of Contents

    Hosting integration

    Thresh.Hosting helps run Thresh safely in service-style applications.

    Typical setup

    builder.Services
        .AddThresh(options =>
        {
            options.AcceptSelfSignedCertificates = true;
            options.WsAcceptSelfSignedCertificates = true;
        })
        .AddThreshEndpoints();
    

    Then register your own hosted service that consumes ILcuHttpClient, endpoint APIs, or IEventStream.

    Recommended lifecycle model

    1. Connect IEventStream at startup.
    2. Wait for connectivity with a bounded timeout.
    3. Subscribe handlers.
    4. Dispose subscriptions and stream during shutdown.

    Reliability tips

    • Keep startup resilient to temporary client absence.
    • Prefer structured logs with endpoint/path context.
    • Use health checks for readiness signaling in orchestrated environments.
    • Edit this page
    In this article
    Back to top Generated by DocFX