cloudi 2.0.4 → 2.0.5

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: ec1f808877875a04bb8cc6d8032477b6b44e0e763ad360f38a3c48bd3cb3d233
4
- data.tar.gz: 1d49c29f896452019b72277eadb93825dea75a3db72848bab5aa0b65bde83f69
3
+ metadata.gz: 65c359d6cff1f2cbbc2a0ab55bc56f97aab5a727ed19c04c8b0dfa7127328189
4
+ data.tar.gz: 3fc6a9b19b78357ff88e10310a60332f78c2006b51fa6d83c6e9458ba91dcb18
5
5
  SHA512:
6
- metadata.gz: 040ba56cf7b16795208479b2d4c8fd0a0fe79f140fe0ca30b6f71c026d7398f8fa583b0de0d8a37667fd6eb9588f7ac0a912d19c6f4102b6aa72c0acf6bc4770
7
- data.tar.gz: fbb6fea699893de2a12b53308b7f48afe84daa2a6caaa50edfad30afce2e893a4314475fe751b8c947b0175f2e1b4dfd353e513169aa41cd66b20e53f2a1a6dc
6
+ metadata.gz: 0b54d32681bd4acdb412a7de6cd54ff185700ef2ca36b882c97777542806fe4ddb9166225527e751e2bb106c6007ee3e960c22d6a39ba50125599b47b6e03bf6
7
+ data.tar.gz: 4a2c223d27dba9eef5516ad15270f5c58ee7985eb40613452a33c7562ada7f1c2617417314c8346cab1fcf7f5475f1440e776556e3960bd5a1dd7c632a23d802
checksums.yaml.gz.sig CHANGED
Binary file
data/README.markdown CHANGED
@@ -1,7 +1,7 @@
1
1
  `cloudi_api_ruby`
2
2
  =================
3
3
 
4
- [![Build Status](https://travis-ci.org/CloudI/cloudi_api_ruby.png)](https://travis-ci.org/CloudI/cloudi_api_ruby)
4
+ [![Build Status](https://app.travis-ci.com/CloudI/cloudi_api_ruby.svg?branch=master)](https://app.travis-ci.com/CloudI/cloudi_api_ruby)
5
5
  [![Gem Package Version](https://img.shields.io/gem/v/cloudi.svg?maxAge=2592000)](https://rubygems.org/gems/cloudi)
6
6
 
7
7
  Ruby [CloudI API](https://cloudi.org/api.html#1_Intro)
data/lib/cloudi.rb CHANGED
@@ -4,7 +4,7 @@
4
4
  #
5
5
  # MIT License
6
6
  #
7
- # Copyright (c) 2011-2021 Michael Truog <mjtruog at protonmail dot com>
7
+ # Copyright (c) 2011-2022 Michael Truog <mjtruog at protonmail dot com>
8
8
  #
9
9
  # Permission is hereby granted, free of charge, to any person obtaining a
10
10
  # copy of this software and associated documentation files (the "Software"),
@@ -166,66 +166,70 @@ module CloudI
166
166
  end
167
167
 
168
168
  def forward_(request_type, name, request_info, request,
169
- timeout, priority, trans_id, pid)
169
+ timeout, priority, trans_id, source)
170
170
  case request_type
171
171
  when ASYNC
172
172
  forward_async(name, request_info, request,
173
- timeout, priority, trans_id, pid)
173
+ timeout, priority, trans_id, source)
174
174
  when SYNC
175
175
  forward_sync(name, request_info, request,
176
- timeout, priority, trans_id, pid)
176
+ timeout, priority, trans_id, source)
177
177
  end
178
178
  end
179
179
 
180
180
  def forward_async(name, request_info, request,
181
- timeout, priority, trans_id, pid)
181
+ timeout, priority, trans_id, source)
182
182
  send(Erlang.term_to_binary([:forward_async, name,
183
183
  OtpErlangBinary.new(request_info),
184
184
  OtpErlangBinary.new(request),
185
185
  timeout, priority,
186
- OtpErlangBinary.new(trans_id), pid]))
186
+ OtpErlangBinary.new(trans_id),
187
+ source]))
187
188
  raise ForwardAsyncException
188
189
  end
189
190
 
190
191
  def forward_sync(name, request_info, request,
191
- timeout, priority, trans_id, pid)
192
+ timeout, priority, trans_id, source)
192
193
  send(Erlang.term_to_binary([:forward_sync, name,
193
194
  OtpErlangBinary.new(request_info),
194
195
  OtpErlangBinary.new(request),
195
196
  timeout, priority,
196
- OtpErlangBinary.new(trans_id), pid]))
197
+ OtpErlangBinary.new(trans_id),
198
+ source]))
197
199
  raise ForwardSyncException
198
200
  end
199
201
 
200
202
  def return_(request_type, name, pattern, response_info, response,
201
- timeout, trans_id, pid)
203
+ timeout, trans_id, source)
202
204
  case request_type
203
205
  when ASYNC
204
206
  return_async(name, pattern, response_info, response,
205
- timeout, trans_id, pid)
207
+ timeout, trans_id, source)
206
208
  when SYNC
207
209
  return_sync(name, pattern, response_info, response,
208
- timeout, trans_id, pid)
210
+ timeout, trans_id, source)
209
211
  end
210
212
  end
211
213
 
212
214
  def return_async(name, pattern, response_info, response,
213
- timeout, trans_id, pid)
215
+ timeout, trans_id, source)
214
216
  send(Erlang.term_to_binary([:return_async, name, pattern,
215
217
  OtpErlangBinary.new(response_info),
216
218
  OtpErlangBinary.new(response),
217
219
  timeout,
218
- OtpErlangBinary.new(trans_id), pid]))
220
+ OtpErlangBinary.new(trans_id),
221
+ source]))
219
222
  raise ReturnAsyncException
220
223
  end
221
224
 
222
225
  def return_sync(name, pattern, response_info, response,
223
- timeout, trans_id, pid)
226
+ timeout, trans_id, source)
224
227
  send(Erlang.term_to_binary([:return_sync, name, pattern,
225
228
  OtpErlangBinary.new(response_info),
226
229
  OtpErlangBinary.new(response),
227
230
  timeout,
228
- OtpErlangBinary.new(trans_id), pid]))
231
+ OtpErlangBinary.new(trans_id),
232
+ source]))
229
233
  raise ReturnSyncException
230
234
  end
231
235
 
@@ -243,12 +247,12 @@ module CloudI
243
247
  end
244
248
 
245
249
  def null_response(request_type, name, pattern, request_info, request,
246
- timeout, priority, trans_id, pid)
250
+ timeout, priority, trans_id, source)
247
251
  return ''
248
252
  end
249
253
 
250
254
  def callback(command, name, pattern, request_info, request,
251
- timeout, priority, trans_id, pid)
255
+ timeout, priority, trans_id, source)
252
256
  function_queue = @callbacks.fetch(pattern, nil)
253
257
  if function_queue.nil?
254
258
  function = method(:null_response)
@@ -262,7 +266,8 @@ module CloudI
262
266
  begin
263
267
  response = function.call(ASYNC, name, pattern,
264
268
  request_info, request,
265
- timeout, priority, trans_id, pid)
269
+ timeout, priority,
270
+ trans_id, source)
266
271
  if response.kind_of?(Array)
267
272
  API.assert{response.length == 2}
268
273
  response_info = response[0]
@@ -296,9 +301,12 @@ module CloudI
296
301
  $stderr.puts e.backtrace
297
302
  return
298
303
  rescue StandardError => e
299
- return_null_response = true
300
304
  $stderr.puts e.message
301
305
  $stderr.puts e.backtrace
306
+ if @fatal_exceptions
307
+ exit(1)
308
+ end
309
+ return_null_response = true
302
310
  rescue SystemExit => e
303
311
  $stderr.puts e.message
304
312
  $stderr.puts e.backtrace
@@ -314,14 +322,15 @@ module CloudI
314
322
  end
315
323
  begin
316
324
  return_async(name, pattern, response_info, response,
317
- timeout, trans_id, pid)
325
+ timeout, trans_id, source)
318
326
  rescue ReturnAsyncException
319
327
  end
320
328
  when MESSAGE_SEND_SYNC
321
329
  begin
322
330
  response = function.call(SYNC, name, pattern,
323
331
  request_info, request,
324
- timeout, priority, trans_id, pid)
332
+ timeout, priority,
333
+ trans_id, source)
325
334
  if response.kind_of?(Array)
326
335
  API.assert{response.length == 2}
327
336
  response_info = response[0]
@@ -355,9 +364,12 @@ module CloudI
355
364
  $stderr.puts e.backtrace
356
365
  return
357
366
  rescue StandardError => e
358
- return_null_response = true
359
367
  $stderr.puts e.message
360
368
  $stderr.puts e.backtrace
369
+ if @fatal_exceptions
370
+ exit(1)
371
+ end
372
+ return_null_response = true
361
373
  rescue SystemExit => e
362
374
  $stderr.puts e.message
363
375
  $stderr.puts e.backtrace
@@ -373,7 +385,7 @@ module CloudI
373
385
  end
374
386
  begin
375
387
  return_sync(name, pattern, response_info, response,
376
- timeout, trans_id, pid)
388
+ timeout, trans_id, source)
377
389
  rescue ReturnSyncException
378
390
  end
379
391
  else
@@ -401,12 +413,13 @@ module CloudI
401
413
  raise TerminateException.new(@timeout_terminate)
402
414
  end
403
415
  when MESSAGE_REINIT
404
- i += j; j = 4 + 4 + 4 + 1
405
- tmp = data[i, j].unpack("LLLc")
416
+ i += j; j = 4 + 4 + 4 + 1 + 1
417
+ tmp = data[i, j].unpack("LLLcC")
406
418
  @process_count = tmp[0]
407
419
  @timeout_async = tmp[1]
408
420
  @timeout_sync = tmp[2]
409
421
  @priority_default = tmp[3]
422
+ @fatal_exceptions = tmp[4]
410
423
  i += j
411
424
  when MESSAGE_KEEPALIVE
412
425
  send(Erlang.term_to_binary(:keepalive))
@@ -471,14 +484,15 @@ module CloudI
471
484
  @process_count_max = tmp[2]
472
485
  @process_count_min = tmp[3]
473
486
  prefix_size = tmp[4]
474
- i += j; j = prefix_size + 4 + 4 + 4 + 4 + 1
475
- tmp = data[i, j].unpack("Z#{prefix_size}LLLLc")
487
+ i += j; j = prefix_size + 4 + 4 + 4 + 4 + 1 + 1
488
+ tmp = data[i, j].unpack("Z#{prefix_size}LLLLcC")
476
489
  @prefix = tmp[0]
477
490
  @timeout_initialize = tmp[1]
478
491
  @timeout_async = tmp[2]
479
492
  @timeout_sync = tmp[3]
480
493
  @timeout_terminate = tmp[4]
481
494
  @priority_default = tmp[5]
495
+ @fatal_exceptions = tmp[6]
482
496
  i += j
483
497
  if i != data_size
484
498
  API.assert{external == false}
@@ -506,9 +520,9 @@ module CloudI
506
520
  request_timeout = tmp[1]
507
521
  priority = tmp[2]
508
522
  trans_id = tmp[3]
509
- pid_size = tmp[4]
510
- i += j; j = pid_size
511
- pid = data[i, j]
523
+ source_size = tmp[4]
524
+ i += j; j = source_size
525
+ source = data[i, j]
512
526
  i += j
513
527
  if i != data_size
514
528
  API.assert{external == true}
@@ -519,7 +533,7 @@ module CloudI
519
533
  data.clear()
520
534
  callback(command, name, pattern, request_info, request,
521
535
  request_timeout, priority, trans_id,
522
- Erlang.binary_to_term(pid))
536
+ Erlang.binary_to_term(source))
523
537
  if @terminate
524
538
  return false
525
539
  end
@@ -575,12 +589,13 @@ module CloudI
575
589
  end
576
590
  API.assert{false}
577
591
  when MESSAGE_REINIT
578
- i += j; j = 4 + 4 + 4 + 1
579
- tmp = data[i, j].unpack("LLLc")
592
+ i += j; j = 4 + 4 + 4 + 1 + 1
593
+ tmp = data[i, j].unpack("LLLcC")
580
594
  @process_count = tmp[0]
581
595
  @timeout_async = tmp[1]
582
596
  @timeout_sync = tmp[2]
583
597
  @priority_default = tmp[3]
598
+ @fatal_exceptions = tmp[4]
584
599
  i += j; j = 4
585
600
  if i == data_size
586
601
  data.clear()
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudi
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Truog
@@ -11,30 +11,30 @@ cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIESDCCArCgAwIBAgIBATANBgkqhkiG9w0BAQsFADAnMSUwIwYDVQQDDBxtanRy
14
- dW9nL0RDPXByb3Rvbm1haWwvREM9Y29tMB4XDTIxMDUyNzIwNTIwMFoXDTIyMDUy
15
- NzIwNTIwMFowJzElMCMGA1UEAwwcbWp0cnVvZy9EQz1wcm90b25tYWlsL0RDPWNv
16
- bTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBAMd6XAi81JZcv5AzNqvx
17
- 7rPXgBArpQVU0zoUCcJ8ZkszXLnaDkyLXZZDWi4tNIZGzkFGzJv2YxQg/ocUzZXF
18
- ixcKuCiUF8nvV58DrFxd8ZYvYMk9GDoU95zIu/brrn6KeFP/nd10vtx46hSlGgeE
19
- 2vzk2pxw8Umml6xwTuximLjVcetas0tIm3kcUAhdWnI7hTgQbPmsGMEtpebpx4Ff
20
- RluZWlBVLt0i1mFpG2BxtGXLFxgxzK/syD8ZHBwaraW5k2ENY163TaJUo2NjDpNF
21
- 0GpcyslZLz0JKKS1RHyuj6fI5cB+7pP/ewbU7ksoMa8zN067gG6Ry75RnKu/Tfzv
22
- Ebh3eBwapuvHnPsWZlyqsPBhoFUH2JUknUgtcg1Q2S6CmzyxdyDaU8OugladoDzF
23
- hWuqx3Mt2cvo1kIUCmxUFtHDzTWy5MP0LMv2IwvU6bbgzgbDndqAj9OesQYTxQ7L
24
- rbMFjq1GW7nQXvU9GEb1WJY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1FDWhgNqsImrLYcca7kcoINTasLWmvfz1xaBeP4MdCk0R
34
+ CUaImqpeG21iNKLYHcNZkGfepUpp4FHudbeQeaJj8R5ug+f402l7T4s3JCAOcVIY
35
+ MqZAStuHt2H1iR+JVSpFx1kkRJncIjtSnxUFd4MsBT083aOme9H/J+tb/YA=
36
36
  -----END CERTIFICATE-----
37
- date: 2021-12-04 00:00:00.000000000 Z
37
+ date: 2022-10-12 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: erlang_rb
@@ -45,7 +45,7 @@ dependencies:
45
45
  version: '2.0'
46
46
  - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: 2.0.4
48
+ version: 2.0.5
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
@@ -55,7 +55,7 @@ dependencies:
55
55
  version: '2.0'
56
56
  - - ">="
57
57
  - !ruby/object:Gem::Version
58
- version: 2.0.4
58
+ version: 2.0.5
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: erlang_rb
61
61
  requirement: !ruby/object:Gem::Requirement
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '2.0'
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 2.0.4
68
+ version: 2.0.5
69
69
  type: :development
70
70
  prerelease: false
71
71
  version_requirements: !ruby/object:Gem::Requirement
@@ -75,7 +75,7 @@ dependencies:
75
75
  version: '2.0'
76
76
  - - ">="
77
77
  - !ruby/object:Gem::Version
78
- version: 2.0.4
78
+ version: 2.0.5
79
79
  description: Ruby CloudI API
80
80
  email: mjtruog@protonmail.com
81
81
  executables: []
metadata.gz.sig CHANGED
Binary file