bumbleworks 0.0.35 → 0.0.36

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,8 +87,16 @@ module Bumbleworks
87
87
  # also be called on all registered observers.
88
88
  define_setting :observers
89
89
 
90
+ # Cancelling a process or waiting for a task to become available are both asynchronous actions
91
+ # performed by Ruote. Bumbleworks waits for the specified timeout before giving up and raising
92
+ # the appropriate Timeout error.
93
+ #
94
+ # default: 5 seconds
95
+ define_setting :timeout
96
+
90
97
  def initialize
91
98
  @storage_adapters = []
99
+ @timeout ||= 5
92
100
  end
93
101
 
94
102
  # Path where Bumbleworks will look for ruote process defintiions to load.
@@ -44,7 +44,7 @@ module Bumbleworks
44
44
  end
45
45
 
46
46
  def cancel_process!(wfid, options = {})
47
- options[:timeout] ||= 5
47
+ options[:timeout] ||= Bumbleworks.timeout
48
48
  unless options[:method] == :kill
49
49
  options[:method] = :cancel
50
50
  end
@@ -65,7 +65,7 @@ module Bumbleworks
65
65
  end
66
66
 
67
67
  def cancel_all_processes!(options = {})
68
- options[:timeout] ||= 5
68
+ options[:timeout] ||= Bumbleworks.timeout
69
69
  unless options[:method] == :kill
70
70
  options[:method] = :cancel
71
71
  end
@@ -125,4 +125,4 @@ module Bumbleworks
125
125
  end
126
126
  end
127
127
  end
128
- end
128
+ end
@@ -62,7 +62,7 @@ module Bumbleworks
62
62
  end
63
63
 
64
64
  def next_available(options = {})
65
- options[:timeout] ||= 5
65
+ options[:timeout] ||= Bumbleworks.timeout
66
66
 
67
67
  start_time = Time.now
68
68
  while first.nil?
@@ -83,4 +83,4 @@ module Bumbleworks
83
83
  end
84
84
  end
85
85
  end
86
- end
86
+ end
@@ -1,3 +1,3 @@
1
1
  module Bumbleworks
2
- VERSION = "0.0.35"
2
+ VERSION = "0.0.36"
3
3
  end
@@ -255,12 +255,12 @@ describe Bumbleworks::Task do
255
255
  Bumbleworks.define_process 'chalking' do
256
256
  concurrence do
257
257
  chalker :task => 'make_chalk_drawings'
258
- hagrid :task => 'moan_endearingly'
259
258
  chalker :task => 'chalk_it_good_baby'
259
+ hagrid :task => 'moan_endearingly'
260
260
  end
261
261
  end
262
262
  Bumbleworks.launch!('chalking')
263
- Bumbleworks.dashboard.wait_for(:chalker)
263
+ Bumbleworks.dashboard.wait_for(:hagrid)
264
264
 
265
265
  tasks = described_class.for_role('chalker')
266
266
  tasks.map(&:nickname).should == [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bumbleworks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.35
4
+ version: 0.0.36
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-09-12 00:00:00.000000000 Z
15
+ date: 2013-09-23 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: ruote
@@ -236,7 +236,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
236
236
  version: '0'
237
237
  segments:
238
238
  - 0
239
- hash: -265632514630841988
239
+ hash: 1823599650182375009
240
240
  required_rubygems_version: !ruby/object:Gem::Requirement
241
241
  none: false
242
242
  requirements:
@@ -245,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
245
245
  version: '0'
246
246
  segments:
247
247
  - 0
248
- hash: -265632514630841988
248
+ hash: 1823599650182375009
249
249
  requirements: []
250
250
  rubyforge_project:
251
251
  rubygems_version: 1.8.23