Projection event handlers can choose which events to listen to, but no which events to not listen to. This may be too limiting. Perhaps we should rewrite the event handler DSL to allow such actions.
Event handlers use event filters from sandthorn_event_filter to choose which events to consume. Maybe we should just make that more explicit and do something like this:
class MySuperProjection < SandthornSequelProjection::Projection
define_handlers do |handlers, filter|
handlers.define my_method:
filter.extract(events: [:new, :foo], types: [MyAggregate, OtherAggregate])
.remove(events: [:bar, :baz], types: [FooAggregate])
end
def my_method(event)
# handle event
end
end
Projection event handlers can choose which events to listen to, but no which events to not listen to. This may be too limiting. Perhaps we should rewrite the event handler DSL to allow such actions.
Event handlers use event filters from
sandthorn_event_filterto choose which events to consume. Maybe we should just make that more explicit and do something like this: