Use FlowState directly in QueueManager#132
Merged
Merged
Conversation
QueueManager now holds a direct FlowState reference (attached by FlowsManager.AddFlow) instead of routing per-flow calls through FlowsManager and a dictionary lookup by StoredId. Removes the corresponding per-id dispatch methods from FlowsManager. Also includes an in-flight Threads -> Subflows rename on FlowState.
Break the FlowState <-> QueueManager construction cycle by dropping QueueManager from FlowState. FlowsManager now exposes CreateFlowState so callers can build FlowState first, pass it into QueueManager via ctor, and then register it with AddFlow(flowState). Separates the two interrupt signals: - QueueManager-local _interruptSignal fires when new messages arrive (woken by Subscribe). - flowState.InterruptSignal fires on external interrupt and is picked up by QueueManager's Initialize loop to trigger FetchMessagesOnce. FlowsManager.Interrupt no longer reaches into QueueManager; it just fires flowState.Interrupt().
When PersistFunctionInStore returns persisted=false the caller only needs the flag to take the early-return branch, so skip constructing effect, correlations, semaphores, flow state, queue manager and workflow. Also completes the CreateFlowState+AddFlow -> CreateFlow migration across the remaining Invoker call sites and the Messaging test templates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FlowStatereference (attached byFlowsManager.AddFlow) instead of callingFlowsManagermethods keyed byStoredId.FlowsManager(SignalInterrupt,GetInterruptedSignal,SuspendThread,ThreadResumed).Suspendstays (still used byDistributedSemaphore).Threads→Subflowsrename onFlowState.Test plan
dotnet test ./Core/Cleipnir.ResilientFunctions.Tests(messaging + full suite)