Skip to content

Modify state properties/behaviour #2

@piratecarrot

Description

@piratecarrot

Currently, there are four properties, Busy, Done, Aborted and Error. To determine that a command has been executed but hasn't finished, there doesn't seem to be any way of doing that. Busy can't be used because it is false prior to the execute command being run.

An idea is to change the properties to
Idle, Executing, Done. These three states tell you what you can do with a command. Idle can be started, Executing can be aborted and Done can fetch results.
Then in the Done state, have Result, which can be, Ok, Aborted or Error. Result would be a struct or an object with an enum of the three possibilities and an error Id. This makes it easy to use with a case statement. I am looking at Rust here with its enum pattern matching for inspiration in terms of code style. This isn't required of course and if statements against booleans would suffice.

Be interested to know your thoughts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions