simpler_workflow 0.2.3 → 0.2.4

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.
@@ -87,16 +87,25 @@ module SimplerWorkflow
87
87
  loop do
88
88
  begin
89
89
  logger.info("Starting activity_loop for #{name}")
90
- domain.activity_tasks.poll_for_single_task(name.to_s) do |task|
91
- logger.info("Received task...")
92
- perform_task(task)
93
- unless task.responded?
94
- if next_activity
95
- result = {:next_activity => next_activity}.to_json
96
- task.complete!(:result => result)
97
- else
98
- task.complete!
90
+ domain.activity_tasks.poll(name.to_s) do |task|
91
+ begin
92
+ logger.info("Received task...")
93
+ perform_task(task)
94
+ unless task.responded?
95
+ if next_activity
96
+ result = {:next_activity => next_activity}.to_json
97
+ task.complete!(:result => result)
98
+ else
99
+ task.complete!
100
+ end
99
101
  end
102
+ rescue => e
103
+ context = {}
104
+ context[:activity_type] = [name.to_s, version]
105
+ context[:input] = task.input
106
+ context[:activity_id] = task.activity_id
107
+ SimplerWorkflow.exception_reporter.report(e, context)
108
+ task.fail! :reason => e.message, :details => { :failure_policy => :abort }.to_json unless task.responded?
100
109
  end
101
110
  end
102
111
  Process.exit(0) if @time_to_exit
@@ -106,13 +115,6 @@ module SimplerWorkflow
106
115
  else
107
116
  retry
108
117
  end
109
- rescue => e
110
- context = {}
111
- context[:activity_type] = [name.to_s, version]
112
- context[:input] = task.input
113
- context[:activity_id] = task.activity_id
114
- SimplerWorkflow.exception_reporter.report(e, context)
115
- raise e
116
118
  end
117
119
  end
118
120
  end
@@ -1,3 +1,3 @@
1
1
  module SimplerWorkflow
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simpler_workflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-01 00:00:00.000000000 Z
12
+ date: 2012-10-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk
@@ -126,7 +126,7 @@ files:
126
126
  - spec/spec_helper.rb
127
127
  homepage: https://github.com/fredjean/simpler_workflow
128
128
  licenses: []
129
- post_install_message: ! "simpler_workflow 0.2.3\n========================\n\nHave
129
+ post_install_message: ! "simpler_workflow 0.2.4\n========================\n\nHave
130
130
  a look at https://github.com/fredjean/simpler_workflow/wiki/MIgrating-to-0.2.0 if
131
131
  you\nare upgrading from a 0.1.x version of the gem. There is a fundamental change
132
132
  in how the \nactivity and decision loops are run. You may need to adjust your application