Skip to content

Conversation

@rneswold
Copy link
Contributor

This pull request implements the changes from #106.

The methods modified by this commit were `async` functions that
awaited on a single `Future`. This commit changes them to a slightly
more complicated signature, but returns the future instead of wrapping
it with another one.
This version of the driver should work as described by the GitHub
issue (DrMemCS#106). It needs analysis by clippy and many unit tests need to
be written before it gets merged, however.
Recommended by clippy.
Recommended by clippy.
@rneswold rneswold linked an issue Apr 18, 2025 that may be closed by this pull request
rneswold added 10 commits April 29, 2025 23:33
Rewrite the function to use a functional pipeline.
These tests make sure the Future interface works.
Previously, the `Devices` type implemented the `Future` trait
directly. This would work in some cases but, in the case of a
`select!` macro, it would fail because that macro drops all the
futures that didn't resolve. Dropping the future would mean dropping
the Devices type.

In this version, the method `.get_next()` returns a `Future` that
returns the next setting. Since the future isn't directly implemented
by `Devices`, it can safely be "cancelled".
@rneswold rneswold merged commit 7d09922 into DrMemCS:main May 24, 2025
3 checks passed
@rneswold rneswold deleted the pr-issue106 branch May 24, 2025 06:28
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.

♻ Improve memory driver

1 participant