envato / event_sourcery

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

Add `shutdown!` method to PollWaiter #133

Closed wingyu closed 7 years ago

wingyu commented 7 years ago

Context

Whenever start is called on an instance of EventSourcery::EventStore::Subscription and an error is raised, shutdown! will be called on its PollWaiter(https://github.com/envato/event_sourcery/blob/master/lib/event_sourcery/event_store/subscription.rb#L27)

However, if the default PollWaiter class is used to initiate EventSourcery::EventStore::Subscription, it will raise a NoMethodError as shutdown! is not defined.

This would not be an issue for event_sourcery-postgres users as it uses EventSourcery::Postgres::OptimisedEventPollWaiter, which has shutdown! defined

twe4ked commented 7 years ago

:+1: @orien

wingyu commented 7 years ago

@twe4ked sorry, I should've provided more context, I've updated the PR comment above, which hopefully clears things up. @orien thanks for the feedback, I'll give that a shot

wingyu commented 7 years ago

@orien I'm going to merge this now since @stevehodgkiss needs this change now. I'll implement your suggestion in a seperate PR after this