Table of Contents

Class LiveSessionOptions

Namespace
DatabentoDotNet.Extensions.Hosting
Assembly
DatabentoDotNet.Extensions.Hosting.dll

One named live session: what to stream, from where, and how to recover.

public sealed class LiveSessionOptions
Inheritance
LiveSessionOptions
Inherited Members

Remarks

Every property is a string, an int, a bool, or a list of those, and that is forced rather than chosen. T:System.TimeSpan is banned as a type, so RS0030 fires on the property declaration and not merely on TimeSpan.FromSeconds; NodaTime's Duration has no TypeConverter and no settable properties, so a binder fills it with nothing; ApiKey validates in its constructor; Symbols has no binder-shaped form at all; and Schema and SType would bind by their C# names — Mbp1 rather than mbp-1 — making the configuration file the only place in the Databento ecosystem where the name is spelled differently.

All of them are therefore resolved rather than bound, by LiveSessionResolver, which is also what LiveSessionValidator calls — the startup validator this options model exists to feed, added by Task 5. One crossing, two callers.

Properties

ApiKey

The session's API key, or null to use the root's.

public string? ApiKey { get; set; }

Property Value

string

CloseTimeout

How long shutdown waits for the gateway to acknowledge a courteous close before dropping the socket instead, as an ISO-8601 duration, or null for five seconds.

public string? CloseTimeout { get; set; }

Property Value

string

Remarks

Keep this below the host's own ShutdownTimeout. The close is a courtesy that runs while the host is already stopping, and the host stops waiting when its own budget expires — so a ceiling above that budget describes a wait which cannot happen. The default five seconds sits well inside the generic host's own default of thirty; a host tuned down near or below five wants this tuned with it, and that is the case this key exists for.

It is not derived from the host's budget, and that is a decision rather than an omission. Reading HostOptions.ShutdownTimeout means referencing Microsoft.Extensions.Hosting — the application composition-root package, which carries the configuration and logging providers behind it — from a library that otherwise needs only Microsoft.Extensions.Hosting.Abstractions. That is a large dependency for every consumer of this package in exchange for one property read, so the number is yours to set rather than ours to infer. See #98.

Zero is rejected at startup rather than accepted: it loses the race on every shutdown, so the session would drop the socket immediately and log a close timeout that never happened.

Compression

Session compression, as a wire string: none or zstd. Defaults to none.

public string? Compression { get; set; }

Property Value

string

Dataset

The dataset, as its wire name — for example EQUS.MINI.

public string? Dataset { get; set; }

Property Value

string

Gateway

The gateway to connect to as host:port, or null to derive it from Dataset.

public string? Gateway { get; set; }

Property Value

string

Remarks

Left null this stays null on the resolved session, so LiveClient derives it through LiveGateway.For. The resolver deliberately does not derive it too: two derivations of one value are two things that can drift.

HeartbeatInterval

The heartbeat interval as an ISO-8601 duration, or null for the gateway's default.

public string? HeartbeatInterval { get; set; }

Property Value

string

ReadTimeout

How long a read may find nothing before the connection is treated as dead, as an ISO-8601 duration, or null for LiveClient's own derivation from the heartbeat interval.

public string? ReadTimeout { get; set; }

Property Value

string

Remarks

This is what turns a silent gateway into a HeartbeatTimeoutException, which is the transient failure the reconnect policy exists for. Lowering it in a test is also how LiveSessionReconnectTests provokes one without waiting thirty-five seconds.

Reconnect

How to recover from a dropped connection.

public ReconnectOptions Reconnect { get; set; }

Property Value

ReconnectOptions

SendTsOut

Whether to ask the gateway to stamp each record with its send time.

public bool SendTsOut { get; set; }

Property Value

bool

SlowReaderBehavior

What the gateway does when this client reads too slowly: warn or skip.

public string? SlowReaderBehavior { get; set; }

Property Value

string

Subscriptions

What to subscribe to. At least one.

public IList<SubscriptionOptions> Subscriptions { get; set; }

Property Value

IList<SubscriptionOptions>