legion 0.0.2 → 0.0.3

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
2
  SHA1:
3
- metadata.gz: f42434869f3fbd249e20f433fe13964d00157a4b
4
- data.tar.gz: 462d1c607be4627681952c9968d2b9f6bf06f615
3
+ metadata.gz: 9997b757982e1c3180cecfd0b0f0170deaa963c9
4
+ data.tar.gz: f216792e4f445b14b818370e5db8a00cdab735bf
5
5
  SHA512:
6
- metadata.gz: 6855d708d2fd03e7fc7ae3a301154e7efdd6fbafbb5b1796403c44e84ef3b06798c7b9c6727bdf7233b09b2f8c58018f750157ac08a47ce5bc10968d19cbff54
7
- data.tar.gz: 21c09d6e2c68a8f0322fe3ffdbf7e7b5f597221f99b0c355f38acfba405e4cf5df45ce9f32f5d72d01cb978449ec9451c1d56d548607c41b8d1c3dc4b4450fd5
6
+ metadata.gz: ad7fe05221635026a6935e2278323e4a33e662f69d2a9fdcaa39d3052ef5e844d5ae2d2a69f2f9f6794c5c91551a8d2ccec1413a63b5b1559c889780bf878b60
7
+ data.tar.gz: 55906773a619d48e87e52c18fc438fe2609f7d93a9aa41fc74c6c76f2324c392e04fd1589eff774ad96650d833273e62e307f997d4bea55a562ac629313fbbd6
data/bin/legion_demo ADDED
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env ruby --
2
+
3
+ require "legion"
4
+
5
+ class Example < Legion::Object
6
+ before(:work) { puts "before hook invoked" }
7
+
8
+ def work(index)
9
+ puts "working on: #{index} ... sleeping for 2 seconds"
10
+ sleep 2
11
+ end
12
+ end
13
+
14
+ def run_example
15
+ puts "Starting 4 processes to run the demo."
16
+ supervisor = Legion::Supervisor.new(Example, processes: 4, port: 52042)
17
+ supervisor.start
18
+ 1000.times { |i| supervisor.work(i) }
19
+ supervisor.stop
20
+ end
21
+
22
+ run_example
23
+
@@ -1,3 +1,3 @@
1
1
  module Legion
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Hopkins
@@ -41,7 +41,8 @@ dependencies:
41
41
  description: Concurrent processing made easy... even for MRI.
42
42
  email:
43
43
  - natehop@gmail.com
44
- executables: []
44
+ executables:
45
+ - legion_demo
45
46
  extensions: []
46
47
  extra_rdoc_files: []
47
48
  files:
@@ -49,7 +50,7 @@ files:
49
50
  - lib/legion/supervisor.rb
50
51
  - lib/legion/version.rb
51
52
  - lib/legion.rb
52
- - test/example.rb
53
+ - bin/legion_demo
53
54
  homepage: https://github.com/hopsoft/legion
54
55
  licenses:
55
56
  - MIT
@@ -74,6 +75,5 @@ rubygems_version: 2.0.3
74
75
  signing_key:
75
76
  specification_version: 4
76
77
  summary: Concurrent processing made easy... even for MRI.
77
- test_files:
78
- - test/example.rb
78
+ test_files: []
79
79
  has_rdoc:
data/test/example.rb DELETED
@@ -1,20 +0,0 @@
1
- require_relative "../lib/legion"
2
-
3
- class Example < Legion::Object
4
- before(:work) { puts "before work" }
5
-
6
- def work(index)
7
- puts "working on: #{index}"
8
- sleep 2
9
- end
10
- end
11
-
12
- def run_example
13
- supervisor = Legion::Supervisor.new(Example, processes: 7, port: 52042)
14
- supervisor.start
15
- 1000.times { |i| supervisor.work(i) }
16
- supervisor.stop
17
- end
18
-
19
- run_example
20
-