Skip to content

[Question] Aggregate trait API #157

Closed

Description

@danieleades

I'm super interested in this crate, and just starting to dig through the codebase. I hope you don't mind me asking questions along the way?

I'm curious about the Aggregate trait. In particular, the Aggregate::handle method returns a Result<Option<Vec<Self::Event>>. Is there a semantic difference in this return type between an Option::None and an empty Vec? If there is, where is it documented?

Activity

  1. iitsdani commented on Sep 3, 2021

    @iitsdani
    Collaborator

    Hey there! Glad to have you here and please, ask all the questions you want! 😄

    Next time consider using the Github Discussion space rather than opening issues though 🙏🏻

    I'm curious about the Aggregate trait. In particular, the Aggregate::handle method returns a Result<Option<Vec<Self::Event>>. Is there a semantic difference in this return type between an Option::None and an empty Vec? If there is, where is it documented?

    No difference, when I wrote the API (too long ago) I was not aware that an empty Vec does not cause memory allocations 😄

    This change was supposed to be part of the v0.5.0 release 👍🏻

  2. danieleades commented on Sep 3, 2021

    @danieleades
    ContributorAuthor

    Next time consider using the Github Discussion space rather than opening issues though

    totally. i thought that as soon as i created the two issues... you used to be able to convert issues to discussions. did that feature get pulled, or do you need to be a repo owner to see the option?

  3. locked and limited conversation to collaborators on Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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