Refactor CassFuture state management - more type safety and clarity #302
Refactor CassFuture state management - more type safety and clarity #302wprzytula wants to merge 3 commits intoscylladb:masterfrom
CassFuture state management - more type safety and clarity #302Conversation
I believe the Default trait gives no benefit there. Also, this prepares for subsequent commits with the refactor.
The refactor involves employing an enum to represent the state of the future: `CassFutureExecution`. This enum has three variants: - `RunningWithoutCallback`: Indicates that the future is currently running without a callback, - `RunningWithCallback`: Indicates that the future is running with a callback, - `Completed`: Indicates that the future has completed, and it contains the result of the future. I hope this refactor makes the state transitions clearer and easier to understand, and, even more importantly, more bug-resistant.
d4851b3 to
78102ad
Compare
|
Have you looked at https://github.com/scylladb/cpp-rust-driver/pull/299/commits? Especially: https://github.com/scylladb/cpp-rust-driver/pull/299/commits/25cb370a4b755be728656b15dda369df830ca5dc and https://github.com/scylladb/cpp-rust-driver/pull/299/commits/665266ce562af98b0007814a31588f9498d77b32. Would you be able to do such refactor on top of them? TLDR, I don't want to store |
Not yet...
OK, I'll try to port it once we merge #299. |
|
The refactor got severaly outdated after #299. It requires significant changes. Moving to draft for now. |
This PR refactors
CassFutureState, so that it is represented in a more type-safe way.Pre-review checklist
[ ] I have implemented Rust unit tests for the features/changes introduced.[ ] I have enabled appropriate tests in.github/workflows/build.ymlingtest_filter.[ ] I have enabled appropriate tests in.github/workflows/cassandra.ymlingtest_filter.