Skip to content

internal: Consolidate duplicate Ticker classes and document package structure#327

Merged
xerial merged 2 commits intomainfrom
feature/consolidate-ticker
Jan 18, 2026
Merged

internal: Consolidate duplicate Ticker classes and document package structure#327
xerial merged 2 commits intomainfrom
feature/consolidate-ticker

Conversation

@xerial
Copy link
Copy Markdown
Member

@xerial xerial commented Jan 18, 2026

Summary

  • Consolidate wvlet.uni.control.Ticker into wvlet.uni.rx.Ticker to eliminate code duplication
  • Add read() and tick() aliases to rx.Ticker for API compatibility with cache module
  • Update cache module imports to use rx.Ticker directly
  • Re-export Ticker from control package for backwards compatibility
  • Add Package Structure section to README documenting all uni packages

Test plan

  • All 938 uni tests pass
  • Compilation succeeds across JVM, JS, and Native platforms

🤖 Generated with Claude Code

…tructure

- Consolidate wvlet.uni.control.Ticker into wvlet.uni.rx.Ticker
- Add read() and tick() aliases to rx.Ticker for API compatibility
- Update cache module to use rx.Ticker directly
- Re-export Ticker from control package for backwards compatibility
- Add Package Structure section to README

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions Bot added doc Improvements or additions to documentation internal Non-user facing changes labels Jan 18, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @xerial, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the project's time-keeping mechanism by consolidating a duplicate Ticker implementation into a single, unified class within the reactive programming module. This change streamlines the codebase, reduces redundancy, and ensures consistent behavior across modules. Additionally, it enhances project documentation by providing a comprehensive overview of the package structure, improving clarity for developers navigating the codebase.

Highlights

  • Code Consolidation: The wvlet.uni.control.Ticker class has been consolidated into wvlet.uni.rx.Ticker to eliminate duplicate code and centralize the time-keeping logic.
  • API Compatibility: Aliases read() and tick() have been added to wvlet.uni.rx.Ticker to maintain API compatibility with the cache module, ensuring a smooth transition during the consolidation.
  • Dependency Updates: Imports within the cache module have been updated to directly reference the consolidated wvlet.uni.rx.Ticker.
  • Backwards Compatibility: The Ticker and ManualTicker classes are now re-exported from the wvlet.uni.control package, preserving backwards compatibility for existing code that might rely on the old package structure.
  • Documentation Enhancement: A new 'Package Structure' section has been added to the README.md file, providing clear documentation of all uni packages and their purposes.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively consolidates the duplicate Ticker classes by moving the implementation to uni-core and using re-exports for backward compatibility. This is a good refactoring that improves code organization. The addition of aliases to maintain API compatibility with the cache module is also well-executed. The documentation update in README.md is a welcome addition, though there's a small opportunity for clarification.

Comment thread README.md Outdated
Comment on lines +32 to +46
| `wvlet.uni.rx` | Reactive primitives (Rx, RxVar, Ticker) |

### uni

| Package | Purpose |
|---------|---------|
| `wvlet.uni.cli` | Terminal styling, progress bars |
| `wvlet.uni.control` | Retry, circuit breaker, resource management |
| `wvlet.uni.control.cache` | In-memory caching with TTL and LRU eviction |
| `wvlet.uni.design` | Dependency injection |
| `wvlet.uni.http` | HTTP client/server |
| `wvlet.uni.io` | Cross-platform file system abstraction |
| `wvlet.uni.json` | JSON parsing |
| `wvlet.uni.msgpack` | MessagePack serialization |
| `wvlet.uni.rx` | Extended reactive features |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The wvlet.uni.rx package is listed under both uni-core and uni modules. While this reflects the source code structure where a package can span multiple modules, it might be confusing for readers trying to understand the project structure. To improve clarity, consider clarifying this relationship.

For example, you could merge these two rows into a single entry that explains both parts, or add a footnote. Another option is to slightly rename them in the documentation to make the distinction clear, like wvlet.uni.rx (core) and wvlet.uni.rx (extended).

Address review feedback: merge uni-core and uni package lists into a
single alphabetically-sorted table to avoid confusion about wvlet.uni.rx
appearing in both modules.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@xerial xerial merged commit 88c24f5 into main Jan 18, 2026
10 checks passed
@xerial xerial deleted the feature/consolidate-ticker branch January 18, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Improvements or additions to documentation internal Non-user facing changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant