Skip to content

Following all events #6

@cheerfulstoic

Description

@cheerfulstoic

👋 Hey, sorry I haven't gotten a chance to check out this project until now!

This is maybe more of a discussion than an issue, but I see you have a all_events and subscribe_all functions. I did actually consider a couple of options for ecto_watch:

  • Allowing people to specify {User, [:inserted, :updated, :deleted]} as watchers and EctoWatch.subscribe({User, [:inserted, :updated, :deleted]}) for subscribing
  • Allowing people to specify {User, :all} as watchers and EctoWatch.subscribe({User, :all}) for subscribing

In the end I decided (at least for the time being) that I would require that people be more explicit about what they're setting up and subscribing to. Especially for the configuration of the watchers it also felt like it was good to stick with requiring that there be one entry in the watchers list for every watcher because each one ends up creating a supervised GenServer.

But this all be a bit unnecessary. Maybe it would be good to allow either a list of events or the :all atom. Either way since you're creating a wrapper around ecto_watch, it could be good to follow its conventions to be less confusing to users of your project.

I'd be happy to hear your thoughts on the above two options.

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