Skip to content

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

@andrew-otiv

Description

@andrew-otiv

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions