Skip to content

Conversation

@refcell
Copy link
Contributor

@refcell refcell commented Jan 13, 2026

Summary

Ported from #395.

Consolidate runtime utilities by replacing separate build_runtime(), run_until_ctrl_c(), and run_until_ctrl_c_fallible() methods with a simpler tokio_runtime() and unified run_until_ctrl_c() that handles runtime creation internally.

Consolidate runtime utilities by replacing separate build_runtime(),
run_until_ctrl_c(), and run_until_ctrl_c_fallible() methods with a
simpler tokio_runtime() and unified run_until_ctrl_c() that handles
runtime creation internally.

Ported from #395.
@refcell refcell self-assigned this Jan 13, 2026
@refcell refcell added A-shared Area: shared crates K-cleanup Kind: general cleanup labels Jan 13, 2026
@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Jan 13, 2026

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

@refcell refcell added this to the v0.4.0 milestone Jan 13, 2026
Copy link
Collaborator

@haardikk21 haardikk21 left a comment

Choose a reason for hiding this comment

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

one question, lgtm otherwise

Comment on lines 24 to 27
res = fut => res,
_ = tokio::signal::ctrl_c() => {
tracing::info!(target: "cli", "Received Ctrl-C, shutting down...");
Ok(())
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe these get matched on in order right? the prev version was biased towards the ctrl c handler over the future resolving - do we want to maintain that behaviour?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah good callout, can bias it towards ctrl+c. By default tokio select! fairness is random so it'd make more sense to bias here.

fn main() -> eyre::Result<()> {
Version::init();
let cli = MyCli::parse();
let _cli = MyCli::parse();
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is the commented code sample underscored 😅 is the linter running on these code blocks too somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea the linter runs on rust code docs. Can ignore by writing ```rust,ignore

@danyalprout danyalprout added this pull request to the merge queue Jan 13, 2026
Merged via the queue into main with commit 23ed22b Jan 13, 2026
29 checks passed
@danyalprout danyalprout deleted the refactor/runtime-simplification branch January 13, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-shared Area: shared crates K-cleanup Kind: general cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants