evil_events 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.hound.yml +2 -0
  3. data/.rubocop.yml +12 -0
  4. data/.travis.yml +3 -2
  5. data/CHANGELOG.md +18 -0
  6. data/evil_events.gemspec +3 -3
  7. data/lib/evil_events/application.rb +7 -0
  8. data/lib/evil_events/core/broadcasting/emitter.rb +5 -7
  9. data/lib/evil_events/core/config.rb +16 -1
  10. data/lib/evil_events/core/events/abstract_event.rb +2 -0
  11. data/lib/evil_events/core/events/event_extensions/class_signature/signature.rb +1 -1
  12. data/lib/evil_events/core/events/event_extensions/class_signature.rb +1 -1
  13. data/lib/evil_events/core/events/event_extensions/emittable.rb +29 -0
  14. data/lib/evil_events/core/events/event_extensions/hookable/abstract_hook.rb +27 -0
  15. data/lib/evil_events/core/events/event_extensions/hookable/after_emit_hook.rb +11 -0
  16. data/lib/evil_events/core/events/event_extensions/hookable/before_emit_hook.rb +11 -0
  17. data/lib/evil_events/core/events/event_extensions/hookable/on_error_hook.rb +16 -0
  18. data/lib/evil_events/core/events/event_extensions/hookable.rb +93 -0
  19. data/lib/evil_events/core/events/event_extensions/type_aliasing.rb +6 -12
  20. data/lib/evil_events/core/events/event_factory.rb +4 -4
  21. data/lib/evil_events/core/events/manager.rb +14 -12
  22. data/lib/evil_events/core/events/manager_factory.rb +2 -7
  23. data/lib/evil_events/core/events/manager_registry.rb +8 -15
  24. data/lib/evil_events/core/events/notifier/abstract.rb +26 -0
  25. data/lib/evil_events/core/events/notifier/builder.rb +43 -0
  26. data/lib/evil_events/core/events/notifier/logging.rb +43 -0
  27. data/lib/evil_events/core/events/notifier/proxy.rb +33 -0
  28. data/lib/evil_events/core/events/notifier/sequential.rb +41 -0
  29. data/lib/evil_events/core/events/notifier/worker/executor.rb +102 -0
  30. data/lib/evil_events/core/events/notifier/worker/job.rb +35 -0
  31. data/lib/evil_events/core/events/notifier/worker.rb +71 -0
  32. data/lib/evil_events/core/events/notifier.rb +6 -0
  33. data/lib/evil_events/core/events/serializers/hash.rb +9 -7
  34. data/lib/evil_events/core/events/serializers/json.rb +11 -6
  35. data/lib/evil_events/core/events/serializers.rb +0 -7
  36. data/lib/evil_events/core/events/subscriber/mixin.rb +2 -2
  37. data/lib/evil_events/core/events.rb +14 -1
  38. data/lib/evil_events/core/system/broadcaster.rb +23 -1
  39. data/lib/evil_events/core/system/mock.rb +7 -0
  40. data/lib/evil_events/core/system.rb +3 -1
  41. data/lib/evil_events/core.rb +0 -1
  42. data/lib/evil_events/error.rb +96 -0
  43. data/lib/evil_events/plugins/{rails.rb → redis_adapter.rb} +2 -2
  44. data/lib/evil_events/plugins/{elastic_search.rb → sidekiq_adapter.rb} +2 -2
  45. data/lib/evil_events/plugins.rb +15 -13
  46. data/lib/evil_events/shared/extensions_mixin.rb +7 -0
  47. data/lib/evil_events/shared/type_converter/converter_registry.rb +2 -2
  48. data/lib/evil_events/shared.rb +1 -0
  49. data/lib/evil_events/version.rb +1 -1
  50. data/lib/evil_events.rb +1 -0
  51. metadata +27 -12
  52. data/lib/evil_events/core/error.rb +0 -8
  53. data/lib/evil_events/core/events/manager/notifier.rb +0 -79
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EvilEvents::Core::Events::Notifier
4
+ # @api private
5
+ # @sicne 0.3.0
6
+ module Builder
7
+ class << self
8
+ # @raise EvilEvents::UnknownNotifierTypeError
9
+ # @return [Notifier::Abstract, Notifier::Sequential, Notifier::Worker]
10
+ #
11
+ # @api private
12
+ # @since 0.3.0
13
+ def build_notifier!
14
+ case EvilEvents::Core::Bootstrap[:config].notifier.type
15
+ when :sequential then build_sequential_notifier!
16
+ when :worker then build_worker_notifier!
17
+ else
18
+ raise EvilEvents::UnknownNotifierTypeError
19
+ end
20
+ end
21
+
22
+ private
23
+
24
+ # @return [Notifier::Sequential]
25
+ #
26
+ # @api private
27
+ # @since 0.3.0
28
+ def build_sequential_notifier!
29
+ options = EvilEvents::Core::Bootstrap[:config].notifier.sequential.to_h
30
+ Sequential.new(**options)
31
+ end
32
+
33
+ # @return [Notifier::Worker]
34
+ #
35
+ # @api private
36
+ # @since 0.3.0
37
+ def build_worker_notifier!
38
+ options = EvilEvents::Core::Bootstrap[:config].notifier.worker.to_h
39
+ Worker.new(**options)
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ # @api private
4
+ # @since 0.3.0
5
+ module EvilEvents::Core::Events::Notifier::Logging
6
+ # @param event [EvilEvents::Core::Events::AbstractEvent]
7
+ # @param subscriber [EvilEvents::Core::Events::Subscriber]
8
+ # @return void
9
+ #
10
+ # @api private
11
+ # @since 0.3.0
12
+ def log_failure(event, subscriber)
13
+ log_activity(event, subscriber, :failed)
14
+ end
15
+
16
+ # @param event [EvilEvents::Core::Events::AbstractEvent]
17
+ # @param subscriber [EvilEvents::Core::Events::Subscriber]
18
+ # @return void
19
+ #
20
+ # @api private
21
+ # @since 0.3.0
22
+ def log_success(event, subscriber)
23
+ log_activity(event, subscriber, :successful)
24
+ end
25
+
26
+ private
27
+
28
+ # @param event [EvilEvents::Core::Events::AbstractEvent]
29
+ # @param subscriber [EvilEvents::Core::Events::Subscriber]
30
+ # @param status [String, Symbol]
31
+ # @return void
32
+ #
33
+ # @api private
34
+ # @since 0.3.0
35
+ def log_activity(event, subscriber, status)
36
+ activity = "EventProcessed(#{event.type})"
37
+ message = "EVENT_ID: #{event.id} :: " \
38
+ "STATUS: #{status} :: " \
39
+ "SUBSCRIBER: #{subscriber.source_object}"
40
+
41
+ EvilEvents::Core::ActivityLogger.log(activity: activity, message: message)
42
+ end
43
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ # @api private
4
+ # @since 0.3.0
5
+ class EvilEvents::Core::Events::Notifier::Proxy
6
+ # @since 0.3.0
7
+ extend Forwardable
8
+
9
+ # @since 0.3.0
10
+ def_delegators :notifier, :shutdown!, :restart!, :notify
11
+
12
+ # @return [Mutex]
13
+ #
14
+ # @api private
15
+ # @since 0.3.0
16
+ attr_reader :initialization_mutex
17
+
18
+ # @api private
19
+ # @since 0.3.0
20
+ def initialize
21
+ @initialization_mutex = Mutex.new
22
+ end
23
+
24
+ # @return [Abstract, Sequential, Worker]
25
+ #
26
+ # @api private
27
+ # @since 0.3.0
28
+ def notifier
29
+ initialization_mutex.synchronize do
30
+ @notifier ||= EvilEvents::Core::Events::Notifier::Builder.build_notifier!
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EvilEvents::Core::Events::Notifier
4
+ # @api private
5
+ # @since 0.3.0
6
+ class Sequential < Abstract
7
+ # @since 0.3.0
8
+ include Logging
9
+
10
+ # @param manager [EvilEvents::Core::Events::Manager]
11
+ # @param event [EvilEvents::Core::Events::AbstractEvent]
12
+ # @raise [EvilEvents::FailedNotifiedSubscribersError]
13
+ # @return void
14
+ #
15
+ # @api private
16
+ # @since 0.3.0
17
+ def notify(manager, event)
18
+ errors_stack = EvilEvents::FailedNotifiedSubscribersError.new
19
+
20
+ event.__call_before_hooks__
21
+
22
+ manager.subscribers.each do |subscriber|
23
+ begin
24
+ subscriber.notify(event)
25
+
26
+ log_success(event, subscriber)
27
+ rescue StandardError => error
28
+ event.__call_on_error_hooks__(error)
29
+
30
+ errors_stack << error
31
+
32
+ log_failure(event, subscriber)
33
+ end
34
+ end
35
+
36
+ event.__call_after_hooks__
37
+
38
+ raise errors_stack unless errors_stack.empty?
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,102 @@
1
+ # frozen_string_literal: true
2
+
3
+ # @api private
4
+ # since 0.3.0
5
+ class EvilEvents::Core::Events::Notifier::Worker::Executor
6
+ # @since 0.3.0
7
+ include EvilEvents::Core::Events::Notifier::Logging
8
+
9
+ # @api public
10
+ # @since 0.3.0
11
+ FALLBACK_POLICIES = {
12
+ exception: :abort,
13
+ ignorance: :discard,
14
+ main_thread: :caller_runs
15
+ }.freeze
16
+
17
+ # @return [Concurrent::ThreadPoolExecutor]
18
+ #
19
+ # @api private
20
+ # @since 0.3.0
21
+ attr_reader :raw_executor
22
+
23
+ # @return [Hash]
24
+ #
25
+ # @api private
26
+ # @since 0.3.0
27
+ attr_reader :options
28
+
29
+ # @option min_threads [Integer]
30
+ # @option max_threads [Integer]
31
+ # @option max_queue [Integer]
32
+ # @option fallback_policy [Symbol]
33
+ # @raise [EvilEvents::IncorrectFallbackPolicyError]
34
+ #
35
+ # @api private
36
+ # @since 0.3.0
37
+ def initialize(min_threads:, max_threads:, max_queue:, fallback_policy:)
38
+ raise EvilEvents::IncorrectFallbackPolicyError unless FALLBACK_POLICIES[fallback_policy]
39
+
40
+ @options = {
41
+ min_threads: min_threads,
42
+ max_threads: max_threads,
43
+ max_queue: max_queue,
44
+ fallback_policy: FALLBACK_POLICIES[fallback_policy]
45
+ }.freeze
46
+
47
+ initialize_raw_executor!(**@options)
48
+ end
49
+
50
+ # @param job [EvilEvents::Core::Events::Notifier::Job]
51
+ # @raise [EvilEvents::WorkerDisabledOrBusyError]
52
+ # @return [Concurrent::Promise]
53
+ #
54
+ # @api private
55
+ # @sicne 0.3.0
56
+ # rubocop:disable Metrics/AbcSize, Style/MultilineBlockChain
57
+ def execute(job)
58
+ Concurrent::Promise.new(executor: raw_executor) do
59
+ job.perform
60
+ end.on_success do
61
+ log_success(job.event, job.subscriber)
62
+ end.on_error do |error|
63
+ job.event.__call_on_error_hooks__(error)
64
+ log_failure(job.event, job.subscriber)
65
+ end.execute
66
+ rescue Concurrent::RejectedExecutionError
67
+ raise EvilEvents::WorkerDisabledOrBusyError
68
+ end
69
+ # rubocop:enable Metrics/AbcSize, Style/MultilineBlockChain
70
+
71
+ # @return void
72
+ #
73
+ # @api private
74
+ # @since 0.3.0
75
+ def shutdown!
76
+ raw_executor.shutdown
77
+ raw_executor.wait_for_termination
78
+ end
79
+
80
+ # @return void
81
+ #
82
+ # @api private
83
+ # @since 0.3.0
84
+ def restart!
85
+ shutdown!
86
+ initialize_raw_executor!(**options)
87
+ end
88
+
89
+ private
90
+
91
+ # @option min_threads [Integer]
92
+ # @option max_threads [Integer]
93
+ # @option max_queue [Integer]
94
+ # @option fallback_policy [Symbol]
95
+ # @return [Concurrent::ThreadPoolExecutor]
96
+ #
97
+ # @api private
98
+ # @since 0.3.0
99
+ def initialize_raw_executor!(**options)
100
+ @raw_executor = Concurrent::ThreadPoolExecutor.new(**options)
101
+ end
102
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ # @api private
4
+ # since 0.3.0
5
+ class EvilEvents::Core::Events::Notifier::Worker::Job
6
+ # @return [EvilEvents::Core::Events::Subscriber]
7
+ #
8
+ # @api private
9
+ # @since 0.3.0
10
+ attr_reader :subscriber
11
+
12
+ # @return [EvilEvents::Core::Events::AbstractEvent]
13
+ #
14
+ # @api private
15
+ # @since 0.3.0
16
+ attr_reader :event
17
+
18
+ # @param event [EvilEvents::Core::Events::AbstractEvent]
19
+ # @param subscriber [EvilEvents::Core::Events::Subscriber]
20
+ #
21
+ # @api private
22
+ # @since 0.3.0
23
+ def initialize(event, subscriber)
24
+ @event = event
25
+ @subscriber = subscriber
26
+ end
27
+
28
+ # @return void
29
+ #
30
+ # @api private
31
+ # @since 0.3.0
32
+ def perform
33
+ subscriber.notify(event)
34
+ end
35
+ end
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EvilEvents::Core::Events::Notifier
4
+ # @api private
5
+ # @since 0.3.0
6
+ class Worker < Abstract
7
+ # @since 0.3.0
8
+ extend Forwardable
9
+
10
+ # @api public
11
+ # @since 0.3.0
12
+ MAIN_THREAD_POLICY = :main_thread
13
+
14
+ # @api public
15
+ # @since 0.3.0
16
+ IGNORANCE_POLICY = :ignorance
17
+
18
+ # @api public
19
+ # @since 0.3.0
20
+ EXCEPTION_POLICY = :exception
21
+
22
+ # @since 0.3.0
23
+ def_delegators :executor, :shutdown!, :restart!
24
+
25
+ # @return [EvilEvents::Core::Events::Notifier::Worker::Executor]
26
+ #
27
+ # @api private
28
+ # @since 0.3.0
29
+ attr_reader :executor
30
+
31
+ # @option min_threads [Integer]
32
+ # @option max_threads [Integer]
33
+ # @option max_queue [Integer]
34
+ # @option fallback_policy [Symbol]
35
+ #
36
+ # @see EvilEvents::Core::Events::Notifier::Worker::Executor
37
+ #
38
+ # @api private
39
+ # @since 0.3.0
40
+ def initialize(min_threads:, max_threads:, max_queue:, fallback_policy: MAIN_THREAD_POLICY)
41
+ @executor = Executor.new(
42
+ min_threads: min_threads,
43
+ max_threads: max_threads,
44
+ max_queue: max_queue,
45
+ fallback_policy: fallback_policy
46
+ )
47
+ end
48
+
49
+ # @param manager [EvilEvents::Core::Events::Manager]
50
+ # @param event [EvilEvents::Core::Events::AbstractEvent]
51
+ #
52
+ # @api private
53
+ # @since 0.3.0
54
+ def notify(manager, event)
55
+ event.__call_before_hooks__
56
+ manager.subscribers.each { |subscriber| schedule_job(event, subscriber) }
57
+ event.__call_after_hooks__
58
+ end
59
+
60
+ private
61
+
62
+ # @param event [EvilEvents::Core::Events::AbstractEvent]
63
+ # @param subscriber [EvilEvents::Core::Events::Subscriber]
64
+ #
65
+ # @api private
66
+ # @since 0.3.0
67
+ def schedule_job(event, subscriber)
68
+ executor.execute(Job.new(event, subscriber))
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ # @api private
4
+ # @since 0.3.0
5
+ module EvilEvents::Core::Events::Notifier
6
+ end
@@ -9,12 +9,14 @@ class EvilEvents::Core::Events::Serializers
9
9
 
10
10
  class << self
11
11
  # @param event [EvilEvents::Core::Events::AbstractEvent]
12
- # @raise [SerializationError]
12
+ # @raise [EvilEvents::SerializationError]
13
13
  # @return [::Hash]
14
14
  #
15
15
  # @since 0.1.0
16
16
  def serialize(event)
17
- raise SerializationError unless event.is_a?(EvilEvents::Core::Events::AbstractEvent)
17
+ unless event.is_a?(EvilEvents::Core::Events::AbstractEvent)
18
+ raise EvilEvents::SerializationError
19
+ end
18
20
 
19
21
  {
20
22
  id: event.id,
@@ -29,21 +31,21 @@ class EvilEvents::Core::Events::Serializers
29
31
  # rubocop:disable Metrics/PerceivedComplexity
30
32
 
31
33
  # @param hash [::Hash]
32
- # @raise [DeserializationError]
34
+ # @raise [EvilEvents::DeserializationError]
33
35
  # @return [EvilEvents::Core::Events::AbstractEvent]
34
36
  #
35
37
  # @since 0.1.0
36
38
  def deserialize(hash)
37
- raise DeserializationError unless hash.is_a?(::Hash)
39
+ raise EvilEvents::DeserializationError unless hash.is_a?(::Hash)
38
40
 
39
41
  event_id = hash[:id] || hash['id']
40
42
  event_type = hash[:type] || hash['type']
41
43
  event_payload = hash[:payload] || hash['payload']
42
44
  event_metadata = hash[:metadata] || hash['metadata']
43
45
 
44
- raise DeserializationError unless event_type && event_payload && event_metadata
45
- raise DeserializationError unless event_payload.is_a?(::Hash)
46
- raise DeserializationError unless event_metadata.is_a?(::Hash)
46
+ raise EvilEvents::DeserializationError unless event_type && event_payload && event_metadata
47
+ raise EvilEvents::DeserializationError unless event_payload.is_a?(::Hash)
48
+ raise EvilEvents::DeserializationError unless event_metadata.is_a?(::Hash)
47
49
 
48
50
  restore_event_instance(
49
51
  type: event_type,
@@ -9,12 +9,14 @@ class EvilEvents::Core::Events::Serializers
9
9
 
10
10
  class << self
11
11
  # @param event [EvilEvents::Core::Events::AbstractEvent]
12
- # @raise [SerializationError]
12
+ # @raise [EvilEvents::SerializationError]
13
13
  # @return [::Hash]
14
14
  #
15
15
  # @since 0.1.0
16
16
  def serialize(event)
17
- raise SerializationError unless event.is_a?(EvilEvents::Core::Events::AbstractEvent)
17
+ unless event.is_a?(EvilEvents::Core::Events::AbstractEvent)
18
+ raise EvilEvents::SerializationError
19
+ end
18
20
 
19
21
  ::JSON.generate(
20
22
  id: event.id,
@@ -25,12 +27,12 @@ class EvilEvents::Core::Events::Serializers
25
27
  end
26
28
 
27
29
  # @param json [String]
28
- # @raise [DeserializationError]
30
+ # @raise [EvilEvents::DeserializationError]
29
31
  # @return [EvilEvents::Core::Events::AbstractEvent]
30
32
  #
31
33
  # @since 0.1.0
32
34
  def deserialize(json)
33
- raise DeserializationError unless json.is_a?(String)
35
+ raise EvilEvents::DeserializationError unless json.is_a?(String)
34
36
 
35
37
  begin
36
38
  json_hash = ::JSON.parse(json, symbolize_names: true)
@@ -38,9 +40,12 @@ class EvilEvents::Core::Events::Serializers
38
40
  event_type = json_hash[:type]
39
41
  event_payload = json_hash[:payload]
40
42
  event_metadata = json_hash[:metadata]
41
- raise DeserializationError unless event_type && event_payload && event_metadata
43
+
44
+ unless event_type && event_payload && event_metadata
45
+ raise EvilEvents::DeserializationError
46
+ end
42
47
  rescue ::JSON::ParserError
43
- raise DeserializationError
48
+ raise EvilEvents::DeserializationError
44
49
  end
45
50
 
46
51
  restore_event_instance(
@@ -6,12 +6,5 @@ module EvilEvents::Core::Events
6
6
  class Serializers
7
7
  # @since 0.1.0
8
8
  extend EvilEvents::Shared::DependencyContainer::Mixin
9
-
10
- # @since 0.1.0
11
- SerializersError = Class.new(EvilEvents::Core::Error)
12
- # @since 0.1.0
13
- SerializationError = Class.new(SerializersError)
14
- # @since 0.1.0
15
- DeserializationError = Class.new(SerializersError)
16
9
  end
17
10
  end
@@ -6,11 +6,11 @@ class EvilEvents::Core::Events::Subscriber
6
6
  Mixin = EvilEvents::Shared::ClonableModuleBuilder.build do
7
7
  # @param event_type [Array<String, Class{EvilEvents::Core::Events::AbstractEvent}, Regexp>]
8
8
  # @param delegator [String, Symbol, NilClass]
9
- # @raise [EvilEvents::Core::ArgumentError]
9
+ # @raise [EvilEvents::ArgumentError]
10
10
  #
11
11
  # @since 0.2.0
12
12
  def subscribe_to(*event_types, delegator: nil)
13
- raise EvilEvents::Core::ArgumentError unless event_types.all? do |event_type|
13
+ raise EvilEvents::ArgumentError unless event_types.all? do |event_type|
14
14
  event_type.is_a?(Class) ||
15
15
  event_type.is_a?(String) ||
16
16
  event_type.is_a?(Regexp) ||
@@ -21,9 +21,22 @@ module EvilEvents::Core
21
21
  require_relative 'events/event_extensions/class_signature'
22
22
  require_relative 'events/event_extensions/class_signature/signature'
23
23
  require_relative 'events/event_extensions/class_signature/equalizer'
24
+ require_relative 'events/event_extensions/hookable'
25
+ require_relative 'events/event_extensions/hookable/abstract_hook'
26
+ require_relative 'events/event_extensions/hookable/after_emit_hook'
27
+ require_relative 'events/event_extensions/hookable/before_emit_hook'
28
+ require_relative 'events/event_extensions/hookable/on_error_hook'
29
+ require_relative 'events/notifier'
30
+ require_relative 'events/notifier/logging'
31
+ require_relative 'events/notifier/abstract'
32
+ require_relative 'events/notifier/sequential'
33
+ require_relative 'events/notifier/worker'
34
+ require_relative 'events/notifier/worker/executor'
35
+ require_relative 'events/notifier/worker/job'
36
+ require_relative 'events/notifier/builder'
37
+ require_relative 'events/notifier/proxy'
24
38
  require_relative 'events/abstract_event'
25
39
  require_relative 'events/manager'
26
- require_relative 'events/manager/notifier'
27
40
  require_relative 'events/manager/subscriber_list'
28
41
  require_relative 'events/manager_factory'
29
42
  require_relative 'events/manager_registry'
@@ -14,10 +14,16 @@ class EvilEvents::Core::System
14
14
  # @since 0.1.0
15
15
  attr_reader :adapters_container
16
16
 
17
+ # @return [EvilEvents::Core::Events::Notifier::Abstract]
18
+ #
19
+ # @since 0.3.0
20
+ attr_reader :event_notifier
21
+
17
22
  # @since 0.1.0
18
23
  def initialize
19
- @event_emitter = EvilEvents::Core::Broadcasting::Emitter.new
20
24
  @adapters_container = EvilEvents::Core::Broadcasting::Adapters.new
25
+ @event_emitter = EvilEvents::Core::Broadcasting::Emitter.new
26
+ @event_notifier = EvilEvents::Core::Events::Notifier::Proxy.new
21
27
 
22
28
  @adapters_container.register_core_adapters!
23
29
  end
@@ -55,5 +61,21 @@ class EvilEvents::Core::System
55
61
  def register_adapter(adapter_name, adapter_object)
56
62
  adapters_container.register(adapter_name, adapter_object)
57
63
  end
64
+
65
+ # @param manager [EvilEvents::Core::Events::Manager]
66
+ # @param event [EvilEvents::Core::Events::AbstractEvent]
67
+ # @return void
68
+ #
69
+ # @since 0.3.0
70
+ def process_event_notification(manager, event)
71
+ event_notifier.notify(manager, event)
72
+ end
73
+
74
+ # @return void
75
+ #
76
+ # @since 0.3.0
77
+ def restart_event_notifier
78
+ event_notifier.restart!
79
+ end
58
80
  end
59
81
  end
@@ -106,5 +106,12 @@ class EvilEvents::Core::System
106
106
  # @see EvilEvents::Core::System
107
107
  # @since 0.2.0
108
108
  def registered_events; end
109
+
110
+ # @see EvilEvents::Core::System
111
+ # @since 0.3.0
112
+ def process_event_notification(manager, event); end
113
+
114
+ # @see EvilEvents::Core::System
115
+ def restart_event_notifier; end
109
116
  end
110
117
  end
@@ -22,7 +22,9 @@ module EvilEvents::Core
22
22
  :emit,
23
23
  :raw_emit,
24
24
  :resolve_adapter,
25
- :register_adapter
25
+ :register_adapter,
26
+ :process_event_notification,
27
+ :restart_event_notifier
26
28
 
27
29
  # @see EvilEvents::Core::System::EventManager
28
30
  # @since 0.1.0
@@ -4,7 +4,6 @@ module EvilEvents
4
4
  # @api private
5
5
  # @since 0.1.0
6
6
  module Core
7
- require_relative 'core/error'
8
7
  require_relative 'core/activity_logger'
9
8
  require_relative 'core/broadcasting'
10
9
  require_relative 'core/events'