concur 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/executor.rb +8 -6
  2. metadata +14 -14
data/lib/executor.rb CHANGED
@@ -98,13 +98,15 @@ module Concur
98
98
 
99
99
  # todo: should maybe have these backends extend Executor and just override what's necessary
100
100
  class SingleThreaded < Executor::Base
101
- def process(f)
101
+ def process(f=nil, &blk)
102
+ f = StandardFuture.new(f, &blk)
102
103
  f.call
104
+ f
103
105
  end
104
106
 
105
- def execute(f)
106
- process(f)
107
- end
107
+ def execute(f=nil, &blk)
108
+ process(f, &blk)
109
+ end
108
110
 
109
111
  def shutdown
110
112
  end
@@ -112,7 +114,7 @@ module Concur
112
114
 
113
115
  # Spins off a new thread per job
114
116
  class MultiThreaded < Executor::Base
115
- def process(f, &blk)
117
+ def process(f=nil, &blk)
116
118
  f = StandardFuture.new(f, &blk)
117
119
  @thread = Thread.new do
118
120
  f.call
@@ -121,7 +123,7 @@ module Concur
121
123
  f
122
124
  end
123
125
 
124
- def execute(f, &blk)
126
+ def execute(f=nil, &blk)
125
127
  process(f, &blk)
126
128
  end
127
129
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concur
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-26 00:00:00.000000000 Z
12
+ date: 2011-11-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine
16
- requirement: &15925020 !ruby/object:Gem::Requirement
16
+ requirement: &11255500 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *15925020
24
+ version_requirements: *11255500
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: em-http-request
27
- requirement: &15924520 !ruby/object:Gem::Requirement
27
+ requirement: &11254080 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *15924520
35
+ version_requirements: *11254080
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: faraday
38
- requirement: &15940340 !ruby/object:Gem::Requirement
38
+ requirement: &11253020 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *15940340
46
+ version_requirements: *11253020
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: eventmachine
49
- requirement: &15939840 !ruby/object:Gem::Requirement
49
+ requirement: &11252360 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *15939840
57
+ version_requirements: *11252360
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: em-http-request
60
- requirement: &15939320 !ruby/object:Gem::Requirement
60
+ requirement: &11074580 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *15939320
68
+ version_requirements: *11074580
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: faraday
71
- requirement: &15938820 !ruby/object:Gem::Requirement
71
+ requirement: &11669620 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *15938820
79
+ version_requirements: *11669620
80
80
  description: A concurrency library for Ruby inspired by java.util.concurrency. By
81
81
  http://www.appoxy.com
82
82
  email: travis@appoxy.com