Skip to content

refactor: seal resilience manager structs pub(crate)#464

Merged
pratyush618 merged 1 commit into
masterfrom
refactor/core-seal-resilience-managers
Jul 20, 2026
Merged

refactor: seal resilience manager structs pub(crate)#464
pratyush618 merged 1 commit into
masterfrom
refactor/core-seal-resilience-managers

Conversation

@pratyush618

@pratyush618 pratyush618 commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

What

The resilience manager structs are public but serve only the in-crate Scheduler. No binding or sibling crate consumes them (bindings drive resilience through Storage methods directly). Seal them:

  • CircuitBreaker (struct + methods) → pub(crate)
  • RateLimiter (struct + methods) → pub(crate)
  • DeadLetterQueue (struct + methods) → pub(crate)
  • Delete Scheduler::circuit_breaker() — dead accessor, zero callers
  • Delete DLQ list/retry/purge — no in-crate caller (would trip dead_code once sealed)

Kept public (config contract, already root-exported): RetryPolicy, RateLimitConfig, CircuitBreakerConfig, CircuitState.

Verify

All green:

  • cargo test --workspace
  • cargo check --workspace --features postgres,redis
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo doc --no-deps -p taskito-core with RUSTDOCFLAGS=-D warnings
  • cargo publish --dry-run -p taskito-core

Summary by CodeRabbit

  • Refactor
    • Resilience components are now internal implementation details rather than publicly accessible APIs.
    • Removed direct access to the scheduler’s circuit breaker.
    • Dead-letter queue listing, retry, and purge operations are no longer exposed externally.
    • Existing circuit breaker, rate limiting, and resilience behavior remains unchanged.

CircuitBreaker/RateLimiter/DeadLetterQueue serve only the in-crate Scheduler; drop the dead circuit_breaker() accessor and unused DLQ list/retry/purge.
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The change narrows resilience APIs to crate-only visibility, removes unused dead-letter queue management methods, and deletes the scheduler’s public circuit-breaker accessor. Internal circuit-breaker, DLQ, and rate-limiter behavior remains unchanged.

Changes

Resilience API Encapsulation

Layer / File(s) Summary
Internalize resilience managers
crates/taskito-core/src/resilience/*
CircuitBreaker, DeadLetterQueue, and RateLimiter types and methods now use pub(crate) visibility. DLQ list, retry, and purge methods were removed.
Remove scheduler breaker accessor
crates/taskito-core/src/scheduler/mod.rs
The public Scheduler::circuit_breaker() accessor was deleted.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • ByteVeda/taskito#456: Touches the same resilience types and may relate to their API visibility adjustments.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: sealing resilience manager structs to crate-only visibility.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/core-seal-resilience-managers

Comment @coderabbitai help to get the list of available commands.

@pratyush618
pratyush618 merged commit edfe9b6 into master Jul 20, 2026
54 of 56 checks passed
@pratyush618
pratyush618 deleted the refactor/core-seal-resilience-managers branch July 20, 2026 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant