Repository navigation
fix: return the schedule builder from job settings so README chains compile - #7
Merged
Merged
Conversation
…ompile
AsTransactional, WithPriority, WithRetryDelaysInSeconds and WithTimeout returned
IJobBuilder<T>, which has no ScheduleAsync / SetRecurrenceAsync, so the chains in
the README ("Scheduling options", "Outbox pattern") failed with CS1061.
IScheduleJobBuilder<T> and IRecurringJobBuilder<T> now declare the settings with
their own return type. Code written against IJobBuilder<T> (e.g. the
SetRecurrenceAsync configure callback) keeps working. The new tests use the README
chains as written, so they stop compiling if this breaks again.
Co-Authored-By: Claude Opus 5.5 <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.
Problem
AsTransactional,WithPriority,WithRetryDelaysInSecondsandWithTimeoutreturnIJobBuilder<T>, which has noScheduleAsync/SetRecurrenceAsync. The chains in the README ("Scheduling options", "Outbox pattern") therefore fail to compile:Fix
IScheduleJobBuilder<T>andIRecurringJobBuilder<T>declare the four settings again (new) with their own return type, so a chain can end withScheduleAsync/SetRecurrenceAsync. Backward compatible: code written againstIJobBuilder<T>, e.g. theconfigurecallback ofIHost.SetRecurrenceAsync, keeps working.Tests
FluentJobBuilderTestsuses the README chains as written, through the publicIScheduler, and checks that the settings reach the stored job (priority, retries, timeout, transactional / outbox, scheduled time, recurrence). Without the fix the file does not compile (same CS1061), so the README examples are now guarded by the build.All 66 unit tests pass on net8.0, net9.0 and net10.0.
Note
Independent of #8 (
fix/recurrence-update); the two branches merge without conflicts. A patch release (2.0.1) would let users drop the workaround of keeping the builder in a variable.🤖 Generated with Claude Code