Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for async on_transition() and on_dispatch() #28

Open
andrew-otiv opened this issue Oct 21, 2024 · 1 comment
Open

support for async on_transition() and on_dispatch() #28

andrew-otiv opened this issue Oct 21, 2024 · 1 comment

Comments

@andrew-otiv
Copy link

We just tried to make all the methods of our state machine async. For on transition we hit:

  --> bazel-out/k8-fastbuild/bin/otiv3/pipeline_manager_process/state_machines/state_machine.rs:87:21
   |
87 |     on_transition = "Self::on_transition",
   |                     ^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found fn item
   |
   = note: expected fn pointer `for<'a, 'b, 'c> fn(&'a mut StateMachineStruct<_>, &'b State, &'c State) -> ()`
                 found fn item `for<'a, 'b, 'c> fn(&'a mut StateMachineStruct<_>, &'b State, &'c State) -> impl Future<Output = ()> {StateMachineStruct::<Handler>::on_transition}`

We get a similar error for on_dispatch. These methods aren't used in your async example. Are they just not supported yet?

Thanks!

@andrew-otiv
Copy link
Author

ON_DISPATCH and ON_TRANSITION in the trait IntoStateMachine are non-async.

Thus, the issue isn't just in the macro.

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

No branches or pull requests

1 participant