maxSamples property

int? maxSamples
final

The number of samples the cache keeps per resource.

null means canon decides — canon's own default (ze_advanced_publisher_cache_options_default) is left untouched.

There is no unlimited setting, and in particular 0 is not one. Measured against zenoh-c 1.8.0: with an explicit 0, a late-joining history subscriber recovers exactly one of five pre-join samples — identical to leaving the field unspecified, because canon's default is 1. Zero remains expressible and is passed through verbatim rather than rejected or swallowed. (Canon does document 0 as "no limit" on the subscriber's history bound, which is a different field on the other side of the contract.)

Must be >= 0; a negative value throws ArgumentError before any native call.

Implementation

final int? maxSamples;