File tree Expand file tree Collapse file tree 7 files changed +12
-12
lines changed
contrib/ruby_event_store-sidekiq_scheduler Expand file tree Collapse file tree 7 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ Declare the scheduler in your Ruby Event Store configuration. We recommend to us
1616
1717``` ruby
1818event_store = RailsEventStore ::Client .new (
19- dispatcher: RailsEventStore ::AfterCommitAsyncDispatcher .new (scheduler: RubyEventStore ::SidekiqScheduler .new (serializer: RubyEventStore ::Serializers ::YAML ),
20- )
19+ dispatcher: RailsEventStore ::AfterCommitDispatcher .new (scheduler: RubyEventStore ::SidekiqScheduler .new (serializer: RubyEventStore ::Serializers ::YAML ),
20+ )
2121```
2222
2323Read more about [ using asynchronous handlers] ( https://railseventstore.org/docs/v2/subscribe/#async-handlers )
Original file line number Diff line number Diff line change 44require "rails_event_store"
55
66module RubyEventStore
7- ::RSpec . describe RailsEventStore ::AfterCommitAsyncDispatcher do
7+ ::RSpec . describe RailsEventStore ::AfterCommitDispatcher do
88 around ( :each ) do |example |
99 ::ActiveRecord ::Base . establish_connection ( adapter : "sqlite3" , database : ":memory:" )
1010 m =
@@ -28,13 +28,13 @@ class DummyRecord < ::ActiveRecord::Base
2828
2929 it_behaves_like :scheduler , SidekiqScheduler . new ( serializer : RubyEventStore ::Serializers ::YAML )
3030
31- it_behaves_like :dispatcher , RailsEventStore ::AfterCommitAsyncDispatcher . new ( scheduler : SidekiqScheduler . new ( serializer : RubyEventStore ::Serializers ::YAML ) )
31+ it_behaves_like :dispatcher , RailsEventStore ::AfterCommitDispatcher . new ( scheduler : SidekiqScheduler . new ( serializer : RubyEventStore ::Serializers ::YAML ) )
3232
3333 let ( :event ) { TimeEnrichment . with ( RubyEventStore ::Event . new ( event_id : "83c3187f-84f6-4da7-8206-73af5aca7cc8" ) ) }
3434 let ( :record ) { RubyEventStore ::Mappers ::Default . new . event_to_record ( event ) }
3535 let ( :serialized_record ) { record . serialize ( YAML ) . to_h . transform_keys ( &:to_s ) }
3636
37- let ( :dispatcher ) { RailsEventStore ::AfterCommitAsyncDispatcher . new ( scheduler : SidekiqScheduler . new ( serializer : RubyEventStore ::Serializers ::YAML ) ) }
37+ let ( :dispatcher ) { RailsEventStore ::AfterCommitDispatcher . new ( scheduler : SidekiqScheduler . new ( serializer : RubyEventStore ::Serializers ::YAML ) ) }
3838
3939 before ( :each ) { TestAsyncHandler . reset }
4040
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33module RailsEventStore
4- class AfterCommitAsyncDispatcher
4+ class AfterCommitDispatcher
55 def initialize ( scheduler :)
66 @scheduler = scheduler
77 end
Original file line number Diff line number Diff line change 33require "ruby_event_store"
44require_relative "async_handler_helpers"
55require_relative "link_by_metadata"
6- require_relative "after_commit_async_dispatcher "
6+ require_relative "after_commit_dispatcher "
77require_relative "active_job_scheduler"
88require_relative 'active_job_id_only_scheduler'
99require_relative "client"
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ def initialize(
99 repository : RubyEventStore ::ActiveRecord ::EventRepository . new ( serializer : RubyEventStore ::Serializers ::YAML ) ,
1010 subscriptions : RubyEventStore ::Subscriptions . new ,
1111 dispatcher : RubyEventStore ::ComposedDispatcher . new (
12- RailsEventStore ::AfterCommitAsyncDispatcher . new (
12+ RailsEventStore ::AfterCommitDispatcher . new (
1313 scheduler : ActiveJobScheduler . new ( serializer : RubyEventStore ::Serializers ::YAML )
1414 ) ,
1515 RubyEventStore ::Dispatcher . new
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def initialize(
2929 repository : RubyEventStore ::ActiveRecord ::EventRepository . new ( serializer : RubyEventStore ::NULL ) ,
3030 subscriptions : RubyEventStore ::Subscriptions . new ,
3131 dispatcher : RubyEventStore ::ComposedDispatcher . new (
32- RailsEventStore ::AfterCommitAsyncDispatcher . new (
32+ RailsEventStore ::AfterCommitDispatcher . new (
3333 scheduler : ActiveJobScheduler . new ( serializer : RubyEventStore ::Serializers ::YAML )
3434 ) ,
3535 RubyEventStore ::Dispatcher . new
Original file line number Diff line number Diff line change 22require "ruby_event_store/spec/dispatcher_lint"
33
44module RailsEventStore
5- ::RSpec . describe AfterCommitAsyncDispatcher do
5+ ::RSpec . describe AfterCommitDispatcher do
66 DummyError = Class . new ( StandardError )
77
88 class DummyRecord < ActiveRecord ::Base
99 self . table_name = "dummy_records"
1010 after_commit -> { raise DummyError }
1111 end
1212
13- it_behaves_like :dispatcher , AfterCommitAsyncDispatcher . new ( scheduler : ActiveJobScheduler . new ( serializer : RubyEventStore ::Serializers ::YAML ) )
13+ it_behaves_like :dispatcher , AfterCommitDispatcher . new ( scheduler : ActiveJobScheduler . new ( serializer : RubyEventStore ::Serializers ::YAML ) )
1414
1515 let ( :event ) { TimeEnrichment . with ( RubyEventStore ::Event . new ( event_id : "83c3187f-84f6-4da7-8206-73af5aca7cc8" ) ) }
1616 let ( :record ) { RubyEventStore ::Mappers ::Default . new . event_to_record ( event ) }
1717 let ( :serialized_record ) { record . serialize ( RubyEventStore ::Serializers ::YAML ) . to_h . transform_keys ( &:to_s ) }
1818
19- let ( :dispatcher ) { AfterCommitAsyncDispatcher . new ( scheduler : ActiveJobScheduler . new ( serializer : RubyEventStore ::Serializers ::YAML ) ) }
19+ let ( :dispatcher ) { AfterCommitDispatcher . new ( scheduler : ActiveJobScheduler . new ( serializer : RubyEventStore ::Serializers ::YAML ) ) }
2020
2121 before ( :each ) { MyActiveJobAsyncHandler . reset }
2222
You can’t perform that action at this time.
0 commit comments