envato / event_sourcery

A library for building event sourced applications in Ruby
MIT License
84 stars 10 forks source link

Revert back to Array for processes_event_types #192

Closed mjward closed 6 years ago

mjward commented 6 years ago

In a previous PR we changed processes_event_types to a Set as a byproduct of refactoring code to prevent a ruby warning. Turns out that Sequel really wants this as an Array.

Previous Change: https://github.com/envato/event_sourcery/commit/3871b38ef4e6ffc4a6a430b8e66d2002291c253d

The result was every EventProcessor was dying because the Sequel gem was unable to convert a Set as a SQL Literal when it tried to subscribe to the event store for changes.

So this just reverts back to using an Array.

stevehodgkiss commented 6 years ago

I'm wondering if it'd be better to convert the Set to an Array within ES Postgres if an array is needed at the time it's used?

mjward commented 6 years ago

I spoke with @orien and I don't think that the refactor was to do with Set, it was mainly because we were using an instance variable before it had been assigned (the ruby warning).

I can't see anything else calling event_source.subscribe, so long as the ES gem passes down what it expects it shouldn't be a problem?

How strongly do we feel about using Set over an Array? I'm neither here nor there.