Fix README API drift against current Cleipnir.NET surface#7
Open
Fix README API drift against current Cleipnir.NET surface#7
Conversation
The README contained several snippets that no longer compile against the actual API in Cleipnir/Flow.cs and Cleipnir.ResilientFunctions: - InitialEffect's first parameter is int Id, not string — pass the effect name via the Alias parameter instead - ControlPanel exposes ScheduleRestart(...).Completion(), not Restart() - ExistingEffects.Remove takes int/EffectId, not a string name - Flow<TParam> requires overriding Run(TParam), but the "Distributed system challenges" snippets defined a non-overriding ProcessOrder method - Lead Messages-abstraction example used the timeout overload, which returns a nullable and contradicts every other example in the doc - Closing class brace missing from the second message-brokered example Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
README snippets had drifted from the actual API in
Cleipnir/Flow.csandCleipnir.ResilientFunctions. Three of them would no longer compile, one had wrong semantics, and a few were structurally inconsistent with the working samples underSamples/andCleipnir.Tests/.Concrete fixes:
new InitialEffect("TransactionId", transactionId)→new InitialEffect(Id: 0, Value: transactionId, Alias: "TransactionId")—InitialEffect's first parameter isint Id(Cleipnir.ResilientFunctions/.../InitialState.cs:16).controlPanel.Restart(...)→controlPanel.ScheduleRestart(...).Completion()— the method onControlPanel<TReturn>isScheduleRestart(ControlPanel.cs:304); matches the pattern used in every sample/test.Effects.Remove("ShipProducts")→Effects.Remove(shipProductsEffectId)—Removetakesint/EffectId(ExistingEffects.cs:91); mirrorsSamples/Cleipnir.Sample.Presentation.AspNet/Controllers/OrderController.cs:36.await Message<FundsReserved>(waitFor: TimeSpan.FromMinutes(5))in the "Messages" abstraction intro withawait Message<FundsReserved>(). ThewaitForoverload returns a nullable timeout result, which the example then ignored — every other example in the doc and the samples uses the parameterless form.public async Task ProcessOrder(Order order)methods in "Distributed system challenges" don't overrideFlow<TParam>.Run(TParam); renamed each topublic override async Task Run(Order order)to match the rest of the doc.}on the second message-brokeredOrderFlowexample.No code paths changed — README only.
Test plan
Samples/Cleipnir.Sample.Presentation.AspNet/Controllers/OrderController.cs,Samples/Cleipnir.Samples.Console/RestartFlow/Example.cs,Cleipnir.Tests/Flows/FunctionRegistrationTests.cs)🤖 Generated with Claude Code