Interface IBowireDeferredSettings

Namespace
Kuestenlogik.Bowire.Plugins
Assembly
Kuestenlogik.Bowire.dll

A plugin whose Settings are not knowable synchronously (#693).

public interface IBowireDeferredSettings

Remarks

Settings is a property, which suits a .NET plugin: it returns a list it already holds. A sidecar plugin does not hold one. Its settings live in the subprocess and arrive in the initialize reply, and the subprocess is spawned lazily — so before anything has called it, the property has nothing truthful to return.

This is the asynchronous half. A caller that is about to read Settings and wants the real answer calls PrepareSettingsAsync(CancellationToken) first; afterwards the property returns what the plugin reported. A plugin that does not implement this interface needs no preparation, which is every .NET plugin.

It is a separate interface rather than a member on IBowireProtocol on purpose: adding it there would change the contract every protocol plugin implements, in every repository, to carry something only sidecars need. That is the same argument IBowirePluginSettings makes for pulling values rather than pushing them.

Methods

PrepareSettingsAsync(CancellationToken)

Do whatever is needed to make Settings answer truthfully — for a sidecar, spawn the process and complete the initialize handshake.

Task PrepareSettingsAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Returns

Task

Remarks

Implementations must not throw: a plugin that cannot be prepared reports no settings, which is the same thing it reported before. The Settings dialog lists every other plugin either way.