event_sourcery 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19b0a0d9e68626a19ba4b628c0b0e835d5f400e0
|
4
|
+
data.tar.gz: 92b65ee0ca76d3044530c77e6a1c56fbb66cc03c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73c8044348497a991169477fd1075bf94bba46c02c686c8f8723bebf4b39f7f902fa38c1e79205520ffc0ed132e2a7cb7033d969de396d435eb1d94fa94645e2
|
7
|
+
data.tar.gz: c0184c613e7d89f4dee8d573913b3ddeda0df8b64a0bc490370a3c7c46be2f92db0f8d62357443af3bc32a7d550f212167d845bced0a6dd7c0d3920bd0b5850b
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
7
7
|
|
8
|
+
## [0.19.0] - 2018-06-06
|
9
|
+
|
10
|
+
### Added
|
11
|
+
|
12
|
+
- Allow passing an `after_fork` lambda to `ESPRunner` that is called after each
|
13
|
+
`ESPProcess` is forked
|
14
|
+
|
8
15
|
## [0.18.0] - 2018-05-23
|
9
16
|
|
10
17
|
- Allow specifying a subscription batch size
|
@@ -129,7 +136,10 @@ moving all Postgres related code into a separate gem.
|
|
129
136
|
- EventSourcery no longer depends on Virtus.
|
130
137
|
- `Command` and `CommandHandler` have been removed.
|
131
138
|
|
132
|
-
[Unreleased]: https://github.com/envato/event_sourcery/compare/v0.
|
139
|
+
[Unreleased]: https://github.com/envato/event_sourcery/compare/v0.19.0...HEAD
|
140
|
+
[0.19.0]: https://github.com/envato/event_sourcery/compare/v0.18.0...v0.19.0
|
141
|
+
[0.18.0]: https://github.com/envato/event_sourcery/compare/v0.17.0...v0.18.0
|
142
|
+
[0.17.0]: https://github.com/envato/event_sourcery/compare/v0.16.0...v0.17.0
|
133
143
|
[0.16.0]: https://github.com/envato/event_sourcery/compare/v0.15.0...v0.16.0
|
134
144
|
[0.15.0]: https://github.com/envato/event_sourcery/compare/v0.14.0...v0.15.0
|
135
145
|
[0.14.0]: https://github.com/envato/event_sourcery/compare/v0.13.0...v0.14.0
|
@@ -1,18 +1,23 @@
|
|
1
1
|
module EventSourcery
|
2
2
|
module EventProcessing
|
3
3
|
class ESPProcess
|
4
|
+
DEFAULT_AFTER_FORK = -> (event_processor) { }
|
5
|
+
|
4
6
|
def initialize(event_processor:,
|
5
7
|
event_source:,
|
6
|
-
subscription_master: EventStore::SignalHandlingSubscriptionMaster.new
|
8
|
+
subscription_master: EventStore::SignalHandlingSubscriptionMaster.new,
|
9
|
+
after_fork:)
|
7
10
|
@event_processor = event_processor
|
8
11
|
@event_source = event_source
|
9
12
|
@subscription_master = subscription_master
|
13
|
+
@after_fork = after_fork || DEFAULT_AFTER_FORK
|
10
14
|
end
|
11
|
-
|
15
|
+
|
12
16
|
# This will start the Event Stream Processor which will subscribe
|
13
17
|
# to the event stream source.
|
14
18
|
def start
|
15
19
|
name_process
|
20
|
+
@after_fork.call(@event_processor)
|
16
21
|
error_handler.with_error_handling do
|
17
22
|
EventSourcery.logger.info("Starting #{processor_name}")
|
18
23
|
subscribe_to_event_stream
|
@@ -6,13 +6,15 @@ module EventSourcery
|
|
6
6
|
def initialize(event_processors:,
|
7
7
|
event_source:,
|
8
8
|
max_seconds_for_processes_to_terminate: 30,
|
9
|
-
shutdown_requested: false
|
9
|
+
shutdown_requested: false,
|
10
|
+
after_fork: nil)
|
10
11
|
@event_processors = event_processors
|
11
12
|
@event_source = event_source
|
12
13
|
@pids = []
|
13
14
|
@max_seconds_for_processes_to_terminate = max_seconds_for_processes_to_terminate
|
14
15
|
@shutdown_requested = shutdown_requested
|
15
16
|
@exit_status = true
|
17
|
+
@after_fork = after_fork
|
16
18
|
end
|
17
19
|
|
18
20
|
# Start each Event Stream Processor in a new child process.
|
@@ -47,7 +49,8 @@ module EventSourcery
|
|
47
49
|
def start_process(event_processor)
|
48
50
|
process = ESPProcess.new(
|
49
51
|
event_processor: event_processor,
|
50
|
-
event_source: @event_source
|
52
|
+
event_source: @event_source,
|
53
|
+
after_fork: @after_fork,
|
51
54
|
)
|
52
55
|
@pids << Process.fork { process.start }
|
53
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: event_sourcery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Envato
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|