Skip to content

Conversation

@robamu
Copy link
Contributor

@robamu robamu commented Nov 19, 2025

Allows running from a mutable reference, which was useful for stuffing the reader into local RTICv2 resources. I could not send it to a task by value because the reader is not sendable.

@robamu robamu marked this pull request as ready for review November 19, 2025 15:58
@Dirbaio
Copy link
Member

Dirbaio commented Nov 19, 2025

this is a limitation in RTIC that doesn't affect embassy-executor. RTIC folks are working on it, see rtic-rs/rtic#1116 rtic-rs/rtic#1108

We shouldn't add workarounds in the public API for this limitation. The problem with allowing &mut is you can cancel the runner then restart it, which can break it if you do it halfway through a transfer.

@robamu
Copy link
Contributor Author

robamu commented Nov 19, 2025

Oh, that is good to know. I have not thought of this case. So this becomes potentially problematic if you just save the future, drop it and then re-run the run method?

Just out of curiosity: Is this not problematic for all runners with the run(&mut self) -> ! style that already exist, or are those runners specifically designed to allow this? I have seen several of those in the code base.

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.

2 participants