event_sourcery-postgres 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b9e184af03e67f103ea4c76b4cd0715d4061af7b
4
- data.tar.gz: 8db961c1dec679cc7a2d01e61a7b7fc7373f1b46
2
+ SHA256:
3
+ metadata.gz: b11be851827e587f05d9707a07efe06dbf27352bfc8692a1d8707b256868be21
4
+ data.tar.gz: dd0b9f260ed14f1a5fe4a034d69cde7b8a5dff394733baca2aa4c73c8b93b018
5
5
  SHA512:
6
- metadata.gz: ea7e49bc760804f1559bb00924200a76601c0ec75b2111260ae6b738e15df1b83ad04bb58d50c9039a3742ec4fb2e708fc840105f30ca2b0bd9cc2e7a8fcc5dd
7
- data.tar.gz: 4bb10f468ce4187fc1182a219840ad6099c49ce5d11a0fdcb4dac79e08b50dc86357777aec3364a5eedb1215652f094fe9578615c64eef822bc91165ded02de9
6
+ metadata.gz: 252a709f64409de25299d2cfc6c3c597d8e0b196e84fc2cbdba52fd8dadd15dec5935a01a866299d00dcb063c2ab0c3afc6562ace8723bd0ad3b6a980dceaa17
7
+ data.tar.gz: af2dd639f3a9563e0f5e20312deb18449270ba407474ddd787141070a7f32341dc2d7a89f8f9815ad8a71cd8b3ddfe0a9c2de727dc9cbfcb3fc299e6556ddc93
@@ -5,6 +5,11 @@ 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.8.0]
9
+ ###
10
+ - Add a `on_events_recorded` config option, that defaults to a no-op proc, \
11
+ to handle any app specific logic after the events are recoded on `EventStore#sink`
12
+
8
13
  ## [0.7.0] - 2018-05-23
9
14
  ### Added
10
15
  - Add a `projector_transaction_size` config option to control how many events
@@ -12,6 +12,11 @@ Gem::Specification.new do |spec|
12
12
 
13
13
  spec.summary = 'Postgres event store for use with EventSourcery'
14
14
  spec.homepage = 'https://github.com/envato/event_sourcery-postgres'
15
+ spec.metadata = {
16
+ 'bug_tracker_uri' => 'https://github.com/envato/event_sourcery-postgres/issues',
17
+ 'changelog_uri' => 'https://github.com/envato/event_sourcery-postgres/blob/master/CHANGELOG.md',
18
+ 'source_code_uri' => 'https://github.com/envato/event_sourcery-postgres',
19
+ }
15
20
 
16
21
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
22
  f.match(%r{^(\.|bin/|Gemfile|Rakefile|script/|spec/)})
@@ -9,7 +9,8 @@ module EventSourcery
9
9
  :callback_interval_if_no_new_events,
10
10
  :auto_create_projector_tracker,
11
11
  :event_tracker,
12
- :projector_transaction_size
12
+ :projector_transaction_size,
13
+ :on_events_recorded
13
14
 
14
15
  attr_writer :event_store,
15
16
  :event_source,
@@ -28,6 +29,7 @@ module EventSourcery
28
29
  @event_store_database = nil
29
30
  @auto_create_projector_tracker = true
30
31
  @projector_transaction_size = 1
32
+ @on_events_recorded = ->(events) {}
31
33
  end
32
34
 
33
35
  def event_store
@@ -7,12 +7,14 @@ module EventSourcery
7
7
  events_table_name: EventSourcery::Postgres.config.events_table_name,
8
8
  lock_table: EventSourcery::Postgres.config.lock_table_to_guarantee_linear_sequence_id_growth,
9
9
  write_events_function_name: EventSourcery::Postgres.config.write_events_function_name,
10
- event_builder: EventSourcery.config.event_builder)
10
+ event_builder: EventSourcery.config.event_builder,
11
+ on_events_recorded: EventSourcery::Postgres.config.on_events_recorded)
11
12
  @db_connection = db_connection
12
13
  @events_table_name = events_table_name
13
14
  @write_events_function_name = write_events_function_name
14
15
  @lock_table = lock_table
15
16
  @event_builder = event_builder
17
+ @on_events_recorded = on_events_recorded
16
18
  end
17
19
 
18
20
  # Like water flowing into a sink eventually it will go down the drain
@@ -33,6 +35,7 @@ module EventSourcery
33
35
  sql = write_events_sql(aggregate_ids.first, events, expected_version)
34
36
  @db_connection.run(sql)
35
37
  log_events_saved(events)
38
+ on_events_recorded.call(events)
36
39
  true
37
40
  rescue Sequel::DatabaseError => e
38
41
  if e.message =~ /Concurrency conflict/
@@ -109,6 +112,8 @@ module EventSourcery
109
112
 
110
113
  private
111
114
 
115
+ attr_reader :on_events_recorded
116
+
112
117
  def events_table
113
118
  @db_connection[@events_table_name]
114
119
  end
@@ -1,5 +1,5 @@
1
1
  module EventSourcery
2
2
  module Postgres
3
- VERSION = '0.7.0'.freeze
3
+ VERSION = '0.8.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: event_sourcery-postgres
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.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-05-23 00:00:00.000000000 Z
11
+ date: 2018-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel
@@ -147,7 +147,10 @@ files:
147
147
  - lib/event_sourcery/postgres/version.rb
148
148
  homepage: https://github.com/envato/event_sourcery-postgres
149
149
  licenses: []
150
- metadata: {}
150
+ metadata:
151
+ bug_tracker_uri: https://github.com/envato/event_sourcery-postgres/issues
152
+ changelog_uri: https://github.com/envato/event_sourcery-postgres/blob/master/CHANGELOG.md
153
+ source_code_uri: https://github.com/envato/event_sourcery-postgres
151
154
  post_install_message:
152
155
  rdoc_options: []
153
156
  require_paths:
@@ -164,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
167
  version: '0'
165
168
  requirements: []
166
169
  rubyforge_project:
167
- rubygems_version: 2.5.2
170
+ rubygems_version: 2.7.6
168
171
  signing_key:
169
172
  specification_version: 4
170
173
  summary: Postgres event store for use with EventSourcery