Skip to content

Replace Options facade with ResilientFunctions Settings#12

Merged
stidsborg merged 2 commits into
mainfrom
replace-options-with-settings
May 30, 2026
Merged

Replace Options facade with ResilientFunctions Settings#12
stidsborg merged 2 commits into
mainfrom
replace-options-with-settings

Conversation

@stidsborg
Copy link
Copy Markdown
Owner

Summary

Cleipnir.Flows.Options had become a 1:1 mirror of Cleipnir.ResilientFunctions.Domain.Settings — same parameters, same order — with Merge helpers that were never called. Every change to RF's Settings (like the leaseLengthreplicaHeartbeatFrequency swap in #11) forced a parallel edit to Options. This removes the duplicate and uses Settings directly.

This works because the RF submodule already exposes Settings' internal properties to the Cleipnir and Cleipnir.Tests assemblies via InternalsVisibleTo.

Changes

  • Deleted Cleipnir/Options.cs.
  • FlowsContainer — constructor and Create now take Settings; passed straight into FunctionsRegistry (no more MapToSettings).
  • FlowsModuleWithOptions(...) and the DI registration now use Settings.
  • FlowOptions.Merge — now takes Settings.
  • Tests & samples — construct new Settings(...) instead of new Options(...) / Options.Default.
  • README — fixed the InitialEffect example to build an EffectId (0.ToEffectId()), matching the current API.

Trade-off

This intentionally exposes RF's Settings type in the Cleipnir.Flows public API (via WithOptions). The previous Options facade shielded consumers from that type, but since it mirrored Settings exactly it provided no real abstraction — only maintenance overhead. FlowOptions (per-flow options) remains a distinct, smaller type and is unchanged in spirit.

Testing

  • dotnet build Cleipnir.NET.sln succeeds.
  • dotnet test Cleipnir.Tests — 25/25 pass.

🤖 Generated with Claude Code

stidsborg and others added 2 commits May 30, 2026 12:33
Options was a 1:1 mirror of ResilientFunctions' Settings (with dead,
never-called Merge methods), so every Settings API change forced a
parallel Options edit. Drop it and use Settings directly.

- Delete Cleipnir/Options.cs
- FlowsContainer/FlowsModule: accept and store Settings; WithOptions
  now takes Settings; pass it straight to FunctionsRegistry
- FlowOptions.Merge now takes Settings
- Tests and samples: construct Settings instead of Options
- README: fix InitialEffect example to use EffectId (0.ToEffectId())

Settings' internal properties are already visible to the Cleipnir and
Cleipnir.Tests assemblies via InternalsVisibleTo in the submodule.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Default the settings parameter to null (falling back to new Settings()),
so callers that don't customize settings can omit the argument entirely.
Drop the now-redundant new Settings() at those call sites.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@stidsborg stidsborg merged commit 78bf200 into main May 30, 2026
1 check passed
@stidsborg stidsborg deleted the replace-options-with-settings branch May 30, 2026 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant