Skip to content

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

Draft
xdustinface wants to merge 2 commits intorefactor/clonable-clientfrom
refactor/client-start-in-run
Draft

refactor: cleanup DashSpvClient to have single run() entry point#457
xdustinface wants to merge 2 commits intorefactor/clonable-clientfrom
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:

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments