fix(focas): fail-fast at init on unimplemented backend (operator footgun)
Add IFocasClientFactory.EnsureUsable() — a config-time probe called by FocasDriver.InitializeAsync before any background loops start. The UnimplementedFocasClientFactory throws NotSupportedException immediately (faulting the driver at init), eliminating the footgun where a driver on the 'unimplemented' backend appeared Healthy then failed every read/write/ subscribe silently. WireFocasClientFactory and FakeFocasClientFactory are no-ops. Backstop Create() throw remains in place.
This commit is contained in:
@@ -427,6 +427,12 @@ public sealed class WireFocasClientFactory : IFocasClientFactory
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// No-op usability probe — the wire backend is always usable at config time.
|
||||
/// Implements <see cref="IFocasClientFactory.EnsureUsable"/>.
|
||||
/// </summary>
|
||||
public void EnsureUsable() { }
|
||||
|
||||
/// <summary>Creates a new WireFocasClient instance.</summary>
|
||||
/// <returns>A new IFocasClient implementation.</returns>
|
||||
public IFocasClient Create() => new WireFocasClient(_logger);
|
||||
|
||||
Reference in New Issue
Block a user