dirty_pipeline 0.8.2 → 0.8.3

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
  SHA256:
3
- metadata.gz: 30736e6846e314622b7be4b807e6d7c6c4adddec24619d4d6cc13c5e88dc38d5
4
- data.tar.gz: 30fde8fe371d9140d8b12f937205cf099df36399fbcc2f4d7b17a5bc8faa5385
3
+ metadata.gz: c994b31257ebb9f48ae2c67ce0d197027f9397ad407944d9f938dabf80dbbe58
4
+ data.tar.gz: 16684ec82ac970097e7add8f2a80e4d45d929d118d0cd88ef8e3584c3f478df0
5
5
  SHA512:
6
- metadata.gz: fccab6567a59465c945f3d2ecf82dd960e813d24defb690fee1da40d35ea0935ce3d3f47d6fb4838581c45ce527ce9502c17c812cb01d3bdf357dd9e2cdb5361
7
- data.tar.gz: 9349d42d38f1c3c7e92b523901466859d0fd1d717e9c40d37f29237a4aa52024102d128aac83fbb8745f6a534fff38ea8409d95ca81caea251d3d211a179cd4b
6
+ metadata.gz: 99ef4a8cc4ce384654c8fc90c1b5bec987955512c942c0c82bac630034e02f8df2ad26ef03f7f7dab961456b24399f6adaa443ccbcf50a0f9a858ea82f5aeb2f
7
+ data.tar.gz: 8482d89667c2ba8906fe553928c37e969256b1db6be91b25364d7d1f1ab5cf253fc8fc5f6ad15e8ef81afc30ba8b07a839ada7d46056571a21d4b0f1aa29e155
@@ -131,8 +131,9 @@ module DirtyPipeline
131
131
  # dispatch event?
132
132
  Transaction.new(self, event).call do |destination, action, *args|
133
133
  state_changes = process_action(action, event, *args)
134
+ event.assign_changes(state_changes)
134
135
  next if status.failure?
135
- Success(event, state_changes, destination)
136
+ Success(event, destination)
136
137
  end
137
138
  call_next
138
139
 
@@ -176,8 +177,8 @@ module DirtyPipeline
176
177
  @status = Status.failure(cause, tag: type)
177
178
  end
178
179
 
179
- def Success(event, changes, destination)
180
- event.complete(changes, destination)
180
+ def Success(event, destination)
181
+ event.complete(destination)
181
182
  @status = Status.success(subject)
182
183
  end
183
184
  end
@@ -86,10 +86,13 @@ module DirtyPipeline
86
86
  @data["attempts_count"] = attempts_count + 1
87
87
  end
88
88
 
89
- def complete(changes, destination)
89
+ def assign_changes(changes)
90
+ @data["changes"] = changes
91
+ end
92
+
93
+ def complete(destination)
90
94
  @data.merge!(
91
95
  "destination" => destination,
92
- "changes" => changes,
93
96
  "updated_at" => Time.now.utc.iso8601,
94
97
  "status" => SUCCESS,
95
98
  )
@@ -81,9 +81,9 @@ module DirtyPipeline
81
81
  return if name.to_s == active
82
82
 
83
83
  with_postgres do |c|
84
- c.exec('START TRANSACTION;')
84
+ # c.exec('START TRANSACTION;')
85
85
  c.exec(SWITCH_OPERATION, [active_operation_key, name])
86
- c.exec('COMMIT;')
86
+ # c.exec('COMMIT;')
87
87
  end
88
88
  end
89
89
 
@@ -133,9 +133,9 @@ module DirtyPipeline
133
133
  def start_transaction!
134
134
  switch_to(DEFAULT_OPERATIONS.first) unless active
135
135
  with_postgres do |c|
136
- c.exec('START TRANSACTION;')
136
+ # c.exec('START TRANSACTION;')
137
137
  c.exec(SWITCH_TRANSACTION, [active_transaction_key, @tx_id])
138
- c.exec('COMMIT;')
138
+ # c.exec('COMMIT;')
139
139
  end
140
140
  end
141
141
 
@@ -1,3 +1,3 @@
1
1
  module DirtyPipeline
2
- VERSION = "0.8.2"
2
+ VERSION = "0.8.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dirty_pipeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Dolganov