Skip to content

Effect: hold FlowState directly instead of FlowsManager + StoredId#153

Merged
stidsborg merged 1 commit into
mainfrom
effect-flowstate-ref
May 25, 2026
Merged

Effect: hold FlowState directly instead of FlowsManager + StoredId#153
stidsborg merged 1 commit into
mainfrom
effect-flowstate-ref

Conversation

@stidsborg
Copy link
Copy Markdown
Owner

Summary

  • Effect now stores a FlowState reference instead of FlowsManager + StoredId. RunParallelle calls flowState.SubflowStarted/Completed directly, skipping the dictionary lookup + lock that FlowsManager.StartThread/CompleteThread did on every call.
  • Removed the now-unused FlowsManager.StartThread / FlowsManager.CompleteThread.
  • Reordered Invoker.PrepareForInvocation / PrepareForReInvocation so _flowsManager.CreateFlow(...) runs before CreateEffect(...), since Effect now requires the FlowState at construction time.

Test plan

  • dotnet build Cleipnir.ResilientFunctions.sln clean
  • In-memory EffectTests and PrintEffectsTests (48 tests) pass
  • RunParallelleTest passes
  • Full DB-backed test suites (PostgreSQL / SqlServer / MariaDB) — touched code paths are runtime-engine only, not store-specific, but worth a CI confirmation

RunParallelle now calls flowState.SubflowStarted/Completed directly,
skipping the per-call dictionary lookup and lock in FlowsManager.
FlowsManager.StartThread/CompleteThread are removed as unused.

Reordered Invoker.PrepareFor(Re)Invocation so CreateFlow runs before
CreateEffect, since Effect now requires the FlowState at construction.
@stidsborg stidsborg merged commit b980c0e into main May 25, 2026
8 checks passed
@stidsborg stidsborg deleted the effect-flowstate-ref branch May 25, 2026 08:48
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