Skip to content

Commit 0f8aef1

Browse files
lukaszreszkemostlyobviousfidel
committed
Rename Dispatcher to SyncScheduler
Co-authored-by: Paweł Pacana <[email protected]> Co-authored-by: Szymon Fiedler <[email protected]>
1 parent 5e97818 commit 0f8aef1

File tree

12 files changed

+24
-24
lines changed

12 files changed

+24
-24
lines changed

contrib/ruby_event_store-profiler/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ event_store =
1010
RubyEventStore::Client.new(
1111
repository: RubyEventStore::InstrumentedRepository.new(RubyEventStore::InMemoryRepository.new, instrumenter),
1212
mapper: RubyEventStore::Mappers::InstrumentedMapper.new(RubyEventStore::Mappers::Default.new, instrumenter),
13-
dispatcher: RubyEventStore::InstrumentedDispatcher.new(RubyEventStore::Dispatcher.new, instrumenter),
13+
dispatcher: RubyEventStore::InstrumentedDispatcher.new(RubyEventStore::SyncScheduler.new, instrumenter),
1414
)
1515

1616
repository = AggregateRoot::InstrumentedRepository.new(AggregateRoot::Repository.new(event_store), instrumenter)

contrib/ruby_event_store-profiler/examples/demo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ asn = ActiveSupport::Notifications
1010
event_store = RubyEventStore::Client.new(
1111
repository: RubyEventStore::InstrumentedRepository.new(RubyEventStore::InMemoryRepository.new, asn),
1212
mapper: RubyEventStore::Mappers::InstrumentedMapper.new(RubyEventStore::Mappers::Default.new, asn),
13-
dispatcher: RubyEventStore::InstrumentedDispatcher.new(RubyEventStore::Dispatcher.new, asn)
13+
dispatcher: RubyEventStore::InstrumentedDispatcher.new(RubyEventStore::SyncScheduler.new, asn)
1414
)
1515
DummyEvent = Class.new(RubyEventStore::Event)
1616
dummy = DummyEvent.new

contrib/ruby_event_store-profiler/spec/profiler_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module RubyEventStore
77
Client.new(
88
repository: InstrumentedRepository.new(InMemoryRepository.new, instrumenter),
99
mapper: Mappers::InstrumentedMapper.new(Mappers::Default.new, instrumenter),
10-
dispatcher: InstrumentedDispatcher.new(Dispatcher.new, instrumenter)
10+
dispatcher: InstrumentedDispatcher.new(SyncScheduler.new, instrumenter)
1111
)
1212
end
1313

contrib/ruby_event_store-protobuf/spec/protobuf_integration_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module RubyEventStore
2828
dispatcher:
2929
ComposedDispatcher.new(
3030
ImmediateDispatcher.new(scheduler: RailsEventStore::ActiveJobScheduler.new(serializer: NULL)),
31-
Dispatcher.new
31+
SyncScheduler.new
3232
)
3333
)
3434
client.subscribe(->(ev) { @ev = ev }, to: [ResTesting::OrderCreated.descriptor.name])

rails_event_store/lib/rails_event_store/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def initialize(
1212
RailsEventStore::AfterCommitDispatcher.new(
1313
scheduler: ActiveJobScheduler.new(serializer: RubyEventStore::Serializers::YAML)
1414
),
15-
RubyEventStore::Dispatcher.new
15+
RubyEventStore::SyncScheduler.new
1616
),
1717
clock: default_clock,
1818
correlation_id_generator: default_correlation_id_generator,

rails_event_store/lib/rails_event_store/json_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def initialize(
3232
RailsEventStore::AfterCommitDispatcher.new(
3333
scheduler: ActiveJobScheduler.new(serializer: RubyEventStore::Serializers::YAML)
3434
),
35-
RubyEventStore::Dispatcher.new
35+
RubyEventStore::SyncScheduler.new
3636
),
3737
clock: default_clock,
3838
correlation_id_generator: default_correlation_id_generator,

ruby_event_store/lib/ruby_event_store.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
require_relative "ruby_event_store/dispatcher"
3+
require_relative "ruby_event_store/sync_scheduler"
44
require_relative "ruby_event_store/subscriptions"
55
require_relative "ruby_event_store/broker"
66
require_relative "ruby_event_store/in_memory_repository"

ruby_event_store/lib/ruby_event_store/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def initialize(
88
repository: InMemoryRepository.new,
99
mapper: Mappers::Default.new,
1010
subscriptions: Subscriptions.new,
11-
dispatcher: Dispatcher.new,
11+
dispatcher: SyncScheduler.new,
1212
clock: default_clock,
1313
correlation_id_generator: default_correlation_id_generator,
1414
event_type_resolver: EventTypeResolver.new

ruby_event_store/lib/ruby_event_store/spec/broker_lint.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
let(:record) { instance_double(::RubyEventStore::Record) }
44
let(:handler) { HandlerClass.new }
55
let(:subscriptions) { ::RubyEventStore::Subscriptions.new }
6-
let(:dispatcher) { ::RubyEventStore::Dispatcher.new }
6+
let(:dispatcher) { ::RubyEventStore::SyncScheduler.new }
77
let(:broker) { broker_klass.new(subscriptions: subscriptions, dispatcher: dispatcher) }
88

99
specify "no dispatch when no subscriptions" do
@@ -48,7 +48,7 @@
4848
allow(dispatcher).to receive(:verify).and_return(false)
4949
expect { broker.add_subscription(HandlerClass, []) }.to raise_error(
5050
RubyEventStore::InvalidHandler,
51-
/Handler HandlerClass is invalid for dispatcher .*Dispatcher/
51+
/Handler HandlerClass is invalid for dispatcher .*SyncScheduler/
5252
)
5353
expect { broker.add_global_subscription(HandlerClass) }.to raise_error(
5454
RubyEventStore::InvalidHandler,

ruby_event_store/lib/ruby_event_store/dispatcher.rb renamed to ruby_event_store/lib/ruby_event_store/sync_scheduler.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
module RubyEventStore
4-
class Dispatcher
4+
class SyncScheduler
55
def call(subscriber, event, _)
66
subscriber.call(event)
77
end

0 commit comments

Comments
 (0)