Skip to content

Serialize BitBox API calls#124

Open
benma wants to merge 2 commits into
BitBoxSwiss:masterfrom
benma:serialize
Open

Serialize BitBox API calls#124
benma wants to merge 2 commits into
BitBoxSwiss:masterfrom
benma:serialize

Conversation

@benma
Copy link
Copy Markdown
Contributor

@benma benma commented May 18, 2026

No description provided.

@benma benma requested a review from Tomasvrba May 18, 2026 18:59
Copy link
Copy Markdown
Collaborator

@NickeZ NickeZ left a comment

Choose a reason for hiding this comment

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

Did you consider having a single task for communication and using channels instead?

The benefit of using a dedicated task that serializes the requests is that the serialization is enforced by the compiler.

No strong opinion though, it just seems like a better pattern to me.

Copy link
Copy Markdown
Collaborator

@Tomasvrba Tomasvrba left a comment

Choose a reason for hiding this comment

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

ack, nice improvement

@benma
Copy link
Copy Markdown
Contributor Author

benma commented May 19, 2026

Did you consider having a single task for communication and using channels instead?

The benefit of using a dedicated task that serializes the requests is that the serialization is enforced by the compiler.

No strong opinion though, it just seems like a better pattern to me.

Only briefly, but I avoided it because it would be a much larger and more invasive change 🤔 Note that the device communication is not (only) the thing that needs to be serialized, but the high level methods like btcSignTx and btcSignMsg need to be serialized - they perform multiple device queries that can't be interleaved.

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.

3 participants