rsf_services 0.8.1 → 0.9.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
  SHA256:
3
- metadata.gz: f51d0994c00d6db8190833b97c33fdda4ff750f1bb613f8e0193b8c8ff68b78b
4
- data.tar.gz: 361f9d646e608efcb006f229aac37315d203501c4798a154d02398f1cd704929
3
+ metadata.gz: 86fb1a368503749f11101ebc687aaf588fd0af90ebf6687ca90f5a67f67036e5
4
+ data.tar.gz: 6abdb89a27223598d3c82e65b63d38c326de50503f83727d8dac29985df8c3c7
5
5
  SHA512:
6
- metadata.gz: 9056e3107d591acdc78c903995086519bb7e1aab0152b5685edad6022a9e45b597a2f8f7d77054253b6ef27a6c9f3d08aa5b35688d4e55a04a081c32e3579fd9
7
- data.tar.gz: ec647817e1d121e363174a259bfa2c4aedfa4d22f77a867a8be7d7ad9bc22d125eb44856d92e2a83c4465e059f534a4f00d485ce4e761b632dc521d70c0922ee
6
+ metadata.gz: 8ab2aec2be43819469b9cacea29e19fa41218e61b571c325138e0c486dcf69f0c025c9daad929e8039678df1d61ccbb3a504d500f970821abbfcebfb404137f6
7
+ data.tar.gz: 191df149e75687e22308c912e2e9acc43d91bd00c998bba54edaad468dfc87e1c0b8c82620a12bb83a1d5c1ca60c70e3f8c35936ccb13d123dd2de0e18a9dace
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -28,7 +28,7 @@ class RSFServices < RScriptRW
28
28
 
29
29
  class Package
30
30
 
31
- def initialize(obj, package, debug: debug)
31
+ def initialize(obj, package, debug: false)
32
32
 
33
33
  @obj, @package, @debug = obj, package, debug
34
34
 
@@ -79,9 +79,11 @@ class RSFServices < RScriptRW
79
79
 
80
80
  puts 'inside RSF_services' if @debug
81
81
 
82
- super(log: log)
82
+ super(log: log, debug: debug)
83
83
 
84
84
  @package_basepath, @services = package_basepath, {}
85
+
86
+ @initialized = {}
85
87
 
86
88
  if reg then
87
89
 
@@ -128,30 +130,50 @@ class RSFServices < RScriptRW
128
130
  PackageMethod.new self, type: :post
129
131
  end
130
132
 
131
- def run_job(package, jobs, params={}, *qargs,
132
- package_path: ("%s/%s.rsf" % [@package_basepath, package]))
133
+ def run_job(package, jobs, params={}, *qargs)
134
+
135
+ puts 'inside run_job' #if @debug
133
136
 
134
- if @log then
135
- @log.info 'RSFServices/run job: ' +
137
+ package_path = "%s/%s.rsf" % [@package_basepath, package]
138
+
139
+ if @log or @debug then
140
+ msg = 'RSFServices/run job: ' +
136
141
  ("package: %s jobs: %s params: %s qargs: %s " + \
137
142
  " package_path: %s" % [package, jobs, params, qargs, package_path])
143
+ @log.info msg if @log
144
+ puts msg if @debug
138
145
  end
139
146
 
140
147
  yield(params) if block_given?
141
148
 
142
- a = [package_path, jobs.split(/\s/).map{|x| "//job:%s" % x} ,qargs].flatten
143
-
144
- c, args = read(a)
149
+ a = [package_path, jobs.split(/\s/).map{|x| "//job:%s" % x} ,qargs].flatten(2)
150
+
151
+ puts 'a: ' + a.inspect if @debug
145
152
 
153
+ c, args, _ = read(a)
154
+ puts 'c: ' + c.inspect if @debug
146
155
  rws, reg, app = self, @registry, @app
147
156
 
148
157
  begin
149
158
 
150
- @log.info 'RSFServices/run job: code: ' + c if @log
159
+ @log.info 'RSFServices/run job: code: ' + c if @log and c.is_a? String
160
+
161
+ # if there is a job id called *initialize* then execute if it hasn't
162
+ # already been executed
163
+
164
+ if self.jobs(package_path).include? :initialize and
165
+ !@initialized[package_path] and jobs != 'initialize' then
166
+ run_job(package, 'initialize')
167
+ @initialized[package_path] = true
168
+ end
151
169
 
152
170
  r = eval c
171
+ puts 'r: ' + r.inspect if @debug
172
+ #thread = Thread.new {Thread.current[:v] = eval c}
173
+ #thread.join
174
+ #r = thread[:v]
153
175
 
154
- @log.info 'RSFServices/run job: result: ' + r if @log
176
+ @log.info 'RSFServices/run job: result: ' + r if @log and r.is_a? String
155
177
 
156
178
  return r
157
179
 
@@ -162,7 +184,7 @@ class RSFServices < RScriptRW
162
184
  @log.debug 'RSFServices/run_job/error: ' + err_label if @log
163
185
 
164
186
  end
165
-
187
+
166
188
  end
167
189
 
168
190
  def package_methods(package)
@@ -175,7 +197,7 @@ class RSFServices < RScriptRW
175
197
 
176
198
  private
177
199
 
178
- def method_missing(method_name, *args)
200
+ def method_missing2(method_name, *args)
179
201
  self.type = :get
180
202
  Package.new self, method_name.to_s, debug: @debug
181
203
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsf_services
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -11,31 +11,31 @@ cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
14
- YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTkwMzA1MTU1MzUxWhcN
15
- MjAwMzA0MTU1MzUxWjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
16
- cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDlYGvg
17
- qZvJhIVpFp3bf26jf3rf4pDQBpTzGZu9M99OZHuVFBaMDm3ogTSe8DTlEPmgNMkB
18
- pguoBZn18Xp+v/XXNHBKtQc/YVj/jdhfwpMvXRsM8kqkPYMne8CK1HMKaIi0xgRC
19
- 5FWiTc04g10M04CES0Eh14zq1bbsXZqSTNN950+vvKq0th7i/pySEZHqXWu5Q0lz
20
- cKtHW5o3BUJoVOKMVO6p2dUk0LjFx5uXHc5Bbxl4uQ2jCTV5tdxYHeP7qXAZI/FE
21
- 2dzF4zb8lWxKt/99C+grAhySE+JOz8WWE4hGU7754nBX0wOT1jrjAKQ+m11FcKBb
22
- TuCw0BR9ZOGqz9KX96NBAfVcH4ooNy7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dvboDI3Etq10pLs+e7cmB/6MkWV9Ba6kOMbJeeXokdjo6A03w/CXW
33
+ kSCp6ydjpEAtQhXpTOOWQfMXwafnNXvcVyh5mtQvSluCdVy0Qf5dHZuMaF+iIdtM
34
+ mS6T6oPPYAVaC+9DHMD5+hJRIo/U5sb+ZUQaHaME8XNCuHGxPbL2WmZr92iKZVCu
35
+ MxhWn7Vf3TxD/7nwBz7wR+H2ONNwWRWmRA7g+Os9YvLEB6LNsJfo+Tyer6bVsSBz
36
+ EOn2RvkdKH17/N7rqiDFRtI2
37
37
  -----END CERTIFICATE-----
38
- date: 2019-03-26 00:00:00.000000000 Z
38
+ date: 2020-06-28 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: dws-registry
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  requirements: []
106
- rubygems_version: 3.0.1
106
+ rubygems_version: 3.0.3
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: Runs within a DRb server to run RSF jobs, as well as other services.
metadata.gz.sig CHANGED
Binary file