-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(torii): make poll time configurable #2327
Conversation
WalkthroughThe recent updates enhance the configuration capabilities of the application by modifying command-line argument handling and internal settings. Key changes include adjusting the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Application
participant Config
User->>Application: Start application with parameters
Application->>Config: Initialize with Args
Config-->>Application: Return updated settings
Application->>Config: Polling operation initiated
Config-->>Application: Use polling_interval
Application->>User: Application is running with new settings
Poem
TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- bin/torii/src/main.rs (3 hunks)
- crates/torii/core/src/engine.rs (3 hunks)
Additional comments not posted (8)
bin/torii/src/main.rs (4)
111-111
: Change toevents_chunk_size
default value is appropriate.The default value for
events_chunk_size
has been updated to1024
, which is a power of two and may improve performance.
115-115
: Change toindex_pending
behavior is sensible.The
index_pending
field now explicitly sets its value, which helps avoid ambiguity in command-line arguments.
118-120
: Addition ofpolling_interval
enhances configurability.The new
polling_interval
field allows users to specify the polling interval in milliseconds, providing more control over the application's behavior.
192-192
: Usage ofpolling_interval
inEngineConfig
is correct.The
polling_interval
is correctly utilized in theEngineConfig
initialization, ensuring the new configuration option is applied.crates/torii/core/src/engine.rs (4)
37-37
: Renamingblock_time
topolling_interval
improves clarity.The field's purpose is clearer, and the default value of 500 milliseconds aligns with the changes in
main.rs
.
46-46
: Default value forpolling_interval
is reasonable.Setting the default to 500 milliseconds balances responsiveness with resource usage.
48-48
: Change toevents_chunk_size
default value is appropriate.Increasing the default to 1024, a power of two, may improve performance.
49-49
: Settingindex_pending
default totrue
is sensible.Indexing pending blocks by default is likely desirable in most scenarios.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2327 +/- ##
==========================================
- Coverage 68.50% 67.30% -1.21%
==========================================
Files 331 354 +23
Lines 41337 46512 +5175
==========================================
+ Hits 28319 31306 +2987
- Misses 13018 15206 +2188 ☔ View full report in Codecov by Sentry. |
Summary by CodeRabbit
New Features
polling_interval
parameter for enhanced control over polling frequency, defaulting to 500 milliseconds.events_chunk_size
default to 1024 for better event chunk management.index_pending
to ensure explicit setting and defaulting to true.Bug Fixes
block_time
topolling_interval
for clarity, improving configuration understanding.These changes enhance the application's configurability and performance, offering users more options for parameter settings.