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

[Command] Allow enum and newtype #15

Open
Freyskeyd opened this issue Sep 12, 2021 · 0 comments
Open

[Command] Allow enum and newtype #15

Freyskeyd opened this issue Sep 12, 2021 · 0 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@Freyskeyd
Copy link
Owner

Command can already be use with enum and newtype but the Command derive only support struct.

#[derive(Debug)]
struct AppendItem(i64);

impl Command for AppendItem {
    type Event = ItemAppended;

    type Executor = ExampleAggregate;

    type ExecutorRegistry = AggregateInstanceRegistry<ExampleAggregate>;

    fn identifier(&self) -> String {
        "example_aggregate".to_string()
    }
}

It could be possible to have an enum which can be dispatch to the CommandExecutor.

Some questions need to be resolved first:

  • How to deal with command's identity ?
  • Is it really necessary ?
@Freyskeyd Freyskeyd added enhancement New feature or request question Further information is requested labels Sep 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant