Skip to content

Document nested @cycles decorator behavior and best practices#17

Merged
amavashev merged 1 commit intomainfrom
claude/analyze-spring-issue-29-vBIY9
Mar 23, 2026
Merged

Document nested @cycles decorator behavior and best practices#17
amavashev merged 1 commit intomainfrom
claude/analyze-spring-issue-29-vBIY9

Conversation

@amavashev
Copy link
Contributor

Summary

Added documentation to the README explaining how nested @cycles decorators behave and providing guidance on recommended usage patterns.

Changes

  • Added new section "Nested @cycles Calls" that explains:

    • Nested @cycles-decorated functions are allowed and won't raise errors
    • Each decorator creates independent reservations that deduct budget separately
    • This results in double-counting of budget when nesting occurs
    • Provided a concrete example showing the budget deduction behavior (600 total instead of 500)
  • Documented recommended pattern:

    • Place @cycles decorator only at the outermost entry point
    • Inner functions should remain plain functions without their own @cycles guard
    • Provided example code showing the recommended approach with single reservation

Details

This is a documentation-only change that clarifies an important behavioral characteristic of the @cycles decorator. The documentation helps users understand potential budget management issues when using nested decorated functions and provides clear guidance on the best practice to avoid unintended budget deductions.

https://claude.ai/code/session_012fx4F3BKF7QHZ5WMN1Jaua

Add section explaining that nested @cycles decorators create independent
reservations that deduct budget separately. Recommend placing the guard
at the outermost entry point only.

Related to runcycles/cycles-spring-boot-starter#29

https://claude.ai/code/session_012fx4F3BKF7QHZ5WMN1Jaua
@amavashev amavashev merged commit 2df74f9 into main Mar 23, 2026
3 checks passed
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.

2 participants