Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable ActiveJob handlers by default in rails_event_store #126

Closed
paneq opened this issue Sep 28, 2017 · 3 comments
Closed

Enable ActiveJob handlers by default in rails_event_store #126

paneq opened this issue Sep 28, 2017 · 3 comments
Milestone

Comments

@paneq
Copy link
Member

paneq commented Sep 28, 2017

Right now we have this code ready but it is not enabled as default dispatcher:

module RailsEventStore
  class Client < RubyEventStore::Client
    def initialize(repository: RailsEventStore.event_repository,
                   event_broker: EventBroker.new,
                   page_size: PAGE_SIZE)
      capture_metadata = ->{ Thread.current[:rails_event_store] }
      super(repository: repository,
            event_broker: event_broker,
            page_size: page_size,
            metadata_proc: capture_metadata)
    end
  end
end

We could detect if active_job is enabled and in such cass pass ActiveJobDispatcher to EventBroker.

ActiveJobDispatcher or standard Dispatcher could be wrapped in instrumentation proxy #90 .

Related to #124 as well

@paneq
Copy link
Member Author

paneq commented Sep 28, 2017

Also, I believe it could be better to have dispatcher as separate dependency, instead of internal dependency of the broker.

@paneq
Copy link
Member Author

paneq commented Oct 27, 2017

After done, fix the documentation in http://railseventstore.org/docs/subscribe/ to no longer require custom config

@paneq paneq added this to the v0.20 milestone Nov 6, 2017
@mpraglowski mpraglowski mentioned this issue Feb 8, 2018
@paneq
Copy link
Member Author

paneq commented Mar 10, 2018

@paneq paneq closed this as completed in 2eb821c Mar 10, 2018
This was referenced Mar 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant