pampa 2.0.30 → 2.0.31

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
  SHA256:
3
- metadata.gz: 8610d7df9639c7fe8e09b420795dc61c0cdb76b4df04b04a935689bec1d3d5be
4
- data.tar.gz: 2c9d0b02219822ca36091805ab2e71ea59285db83255da737acd84d23eda7414
3
+ metadata.gz: af7a0536c38fa454e4f28d00ec1be0d13399d6dffb2d390e8128f417c8f7af8e
4
+ data.tar.gz: 11bd7721b54ae0a8e3ae56702ab3891272ab8818ccfb3d04da077b747cfed833
5
5
  SHA512:
6
- metadata.gz: 4500f05166c288b46cdce8f6c361cc9ca9a26314300b1e97248474ac2be432d863b2e34e0e3b24398c677910ef109ca0cbdeddf65d5fc387227560806966d784
7
- data.tar.gz: e364de99b69c3c93b30fb59f69450a5e8637e91f36d8b810fb7eeb19b084c1686362841a48a1118aadc2fe347f31b0a3c2fc370754cbe536d941d1f770a2de4d
6
+ metadata.gz: 3dd788d3ab9b61d0c36cf777cd2233dbed35a8c21b32b12ed2e393d77ed12f034a27bfb9f6cd4fc6d81d20f714babd96c73e6d916e68439bd22fb629d185e42b
7
+ data.tar.gz: 24a4bb824b6d4d39572e23033508f846d799f0cd5681c896a25298ef352b09cd5df58b1fe1a82ab25f9307658f236080b72880ab57234f70862cf28ae3a13d70
@@ -60,6 +60,16 @@ else
60
60
  end
61
61
  l.logf 'done'.green
62
62
 
63
+ # call dispatcher code snippet
64
+ l.logs 'Calling dispatcher code snippet... '
65
+ f = BlackStack::Pampa.dispatcher_function
66
+ if f
67
+ f.call
68
+ l.logf 'done'.green
69
+ else
70
+ l.logf 'no dispatcher code snippet found'.yellow
71
+ end
72
+
63
73
  # loop
64
74
  begin
65
75
  while true
data/lib/pampa/worker.rb CHANGED
@@ -66,6 +66,16 @@ else
66
66
  end
67
67
  l.logf 'done'.green
68
68
 
69
+ # call dispatcher code snippet
70
+ l.logs 'Calling worker code snippet... '
71
+ f = BlackStack::Pampa.worker_function
72
+ if f
73
+ f.call
74
+ l.logf 'done'.green
75
+ else
76
+ l.logf 'no worker code snippet found'.yellow
77
+ end
78
+
69
79
  begin
70
80
  # getting the worker object
71
81
  l.logs 'Getting worker '+PARSER.value('id').blue+'... '
data/lib/pampa.rb CHANGED
@@ -12,6 +12,8 @@ module BlackStack
12
12
  @@nodes = []
13
13
  @@jobs = []
14
14
  @@logger = BlackStack::DummyLogger.new(nil)
15
+ @@dispatcher_function = nil
16
+ @@worker_function = nil
15
17
 
16
18
  # add a node to the cluster.
17
19
  def self.add_node(h)
@@ -69,6 +71,21 @@ module BlackStack
69
71
  @@logger = l
70
72
  end
71
73
 
74
+
75
+ def self.set_snippets(h)
76
+ @@dispatcher_function = h[:dispatcher_function]
77
+ @@worker_function = h[:worker_function]
78
+ end
79
+
80
+ def self.dispatcher_function
81
+ @@dispatcher_function
82
+ end
83
+
84
+ def self.worker_function
85
+ @@worker_function
86
+ end
87
+
88
+
72
89
  # get attached and unassigned workers.
73
90
  # assign and unassign workers to jobs.
74
91
  #
data/pampa.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'pampa'
3
- s.version = '2.0.30'
4
- s.date = '2023-10-06'
3
+ s.version = '2.0.31'
4
+ s.date = '2023-10-07'
5
5
  s.summary = "Ruby library for async & distributed computing, supporting dynamic reconfiguration, distribution of the computation jobs, error handling, job-retry and fault tolerance, and fast (non-direct) communication to ensure real-time capabilities."
6
6
  s.description = "Pampa is a Ruby library for async & distributing computing providing the following features:
7
7
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pampa
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.30
4
+ version: 2.0.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Daniel Sardi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-06 00:00:00.000000000 Z
11
+ date: 2023-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubygems-bundler