commanded-ecto-projections
                                
                                 commanded-ecto-projections copied to clipboard
                                
                                    commanded-ecto-projections copied to clipboard
                            
                            
                            
                        Improvement: Skip noop events
This PR does two things:
- it refactors the ecto.exfile a bit to make it more readable (30b90ab and 57279c1)
- it adds logic to ignore "noop" events (everything else)
Noop events are events which return an unaltered multi struct. In our project there are a few projections which determine whether or not an update is necessary based whether or not certain entries have been created before by the projection. If no update is necessary the projection simply returns the unaltered multi struct.
In this case the projection now treats the noop events the same as ignored events and never does a DB roundtrip. This will increase performance for noop events considerably. To allow users to handle noop cases specifically the projection now has a new call_after_update_for_noop? option which, as the name suggests, adds a call to after_update with the :noop atom instead of changes.
TODO
- [ ] Update the README and docs
@Zeeker If this PR is code complete I'm happy to merge it in. Just let me know.
Uh, I totally forgot about this. I'll see that I finish this soon.