peplum 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/peplum/application.rb +8 -2
- data/lib/peplum/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c2c58c0b4f8d82bb6376ca24b17b1b07585630e257f0c38717d19a02a71ce76
|
4
|
+
data.tar.gz: 235f665ccb1f8c49d6a991166a55f5871556a483c3b57937d89427cf5694a2f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6625f8916a0cfb646972c700d1f68cd7d97ba5fbc23f9637896190fffdce28f64c2878e2cc0c811ba37702fab63fe1fa65f0e8561203cbad420177e293e82a7c
|
7
|
+
data.tar.gz: 22cf60063e6040de45ba80c3fb5cfa1930898bcd46615b6ce80bf67baa12d4b9eb30ca9d8e79c3cbdc6b635600fb29e14eadac9940cb00a144ac0c6b7cf71f22
|
data/lib/peplum/application.rb
CHANGED
@@ -25,6 +25,7 @@ module Peplum
|
|
25
25
|
end
|
26
26
|
|
27
27
|
attr_reader :peers
|
28
|
+
attr_reader :master
|
28
29
|
|
29
30
|
def initialize(*)
|
30
31
|
super
|
@@ -51,6 +52,11 @@ module Peplum
|
|
51
52
|
end
|
52
53
|
end
|
53
54
|
|
55
|
+
def worker?
|
56
|
+
# Has a master?
|
57
|
+
!!@master
|
58
|
+
end
|
59
|
+
|
54
60
|
# Implements:
|
55
61
|
# * `.run` -- Worker; executes its payload against `objects`.
|
56
62
|
# * `.group` -- Splits given `objects` into groups for each worker.
|
@@ -71,13 +77,13 @@ module Peplum
|
|
71
77
|
|
72
78
|
def execute( peplum_options, payload_options )
|
73
79
|
master_info = peplum_options.delete( 'master' )
|
80
|
+
@master = Processes::Instances.connect( master_info['url'], master_info['token'] )
|
74
81
|
|
75
82
|
self.peers.set( peplum_options.delete( 'peers' ) || {} )
|
76
83
|
|
77
84
|
report_data = payload.run( peplum_options['objects'], payload_options )
|
78
85
|
|
79
|
-
master
|
80
|
-
master.scheduler.report report_data, Cuboid::Options.rpc.url
|
86
|
+
@master.scheduler.report report_data, Cuboid::Options.rpc.url
|
81
87
|
end
|
82
88
|
|
83
89
|
def schedule( peplum_options, payload_options )
|
data/lib/peplum/version.rb
CHANGED