Skip to content

Comments

refactor: cleanup DashSpvClient to have single run() entry point#457

Draft
xdustinface wants to merge 3 commits intov0.42-devfrom
refactor/client-start-in-run
Draft

refactor: cleanup DashSpvClient to have single run() entry point#457
xdustinface wants to merge 3 commits intov0.42-devfrom
refactor/client-start-in-run

Conversation

@xdustinface
Copy link
Collaborator

@xdustinface xdustinface commented Feb 18, 2026

Combine start() + monitor_network() + stop() into a single run(token) entry point. Callers no longer need to call start() separately since run() handles the full lifecycle and returns after the token is cancelled.

  • Make start() an internal function
  • Remove monitor_network() its loop is now inside run()
  • Remove dash_spv_ffi_client_start so that dash_spv_ffi_client_run is the only FFI entry point
  • Move ctrl-c handling out of the client

Based on:

All fields wrapped in `Arc` with locks. Callers hold a handle while the monitoring loop runs in a
spawned task via `run()` getting rid of the command channel pattern.
Make monitoring and sync run as tokio tasks instead of dedicated
OS threads. This removes the `std::thread::spawn` + `block_on` pattern
and uses the existing tokio runtime directly.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 18, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/client-start-in-run

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Combine `start()` + `monitor_network()` + `stop()` into a single `run(token)` entry
point. Callers no longer need to call `start()` separately since `run()` handles
the full lifecycle and returns after the token is cancelled.

- Make `start()` an internal function
- Remove `monitor_network()` its loop is now inside `run()`
- Remove `dash_spv_ffi_client_start` so that `dash_spv_ffi_client_run` is the only FFI entry point
- Move ctrl-c handling out of the client
@xdustinface xdustinface force-pushed the refactor/client-start-in-run branch from ba63b6a to 1d325f3 Compare February 18, 2026 23:02
Base automatically changed from refactor/clonable-client to v0.42-dev February 19, 2026 18:57
@github-actions github-actions bot added the merge-conflict The PR conflicts with the target branch. label Feb 19, 2026
@github-actions
Copy link

This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-conflict The PR conflicts with the target branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant