cloudi 2.0.2 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.markdown +1 -1
- data/lib/cloudi.rb +48 -33
- data.tar.gz.sig +0 -0
- metadata +28 -28
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65c359d6cff1f2cbbc2a0ab55bc56f97aab5a727ed19c04c8b0dfa7127328189
|
4
|
+
data.tar.gz: 3fc6a9b19b78357ff88e10310a60332f78c2006b51fa6d83c6e9458ba91dcb18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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-
|
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,
|
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,
|
173
|
+
timeout, priority, trans_id, source)
|
174
174
|
when SYNC
|
175
175
|
forward_sync(name, request_info, request,
|
176
|
-
timeout, priority, trans_id,
|
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,
|
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),
|
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,
|
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),
|
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,
|
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,
|
207
|
+
timeout, trans_id, source)
|
206
208
|
when SYNC
|
207
209
|
return_sync(name, pattern, response_info, response,
|
208
|
-
timeout, trans_id,
|
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,
|
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),
|
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,
|
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),
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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("
|
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}
|
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
|
-
|
510
|
-
i += j; j =
|
511
|
-
|
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(
|
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("
|
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
|
+
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
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|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25tYWlsLmNvbTAhBgNVHRIEGjAY
|
27
|
+
gRZtanRydW9nQHByb3Rvbm1haWwuY29tMA0GCSqGSIb3DQEBCwUAA4IBgQC8NHmm
|
28
|
+
ytJq5FerCrZhwcyUN+OkBP5xDO3N5Vv7v5AcJ8R4+XpEE0J+Xi5ZPNRwDcVVA1f3
|
29
|
+
QPYrzFhgAFh9Fj7vzeYJIe3gGEgLvJZe5t5sTQCg1O4hg97qUrXz894KUMYzxFxv
|
30
|
+
r5Ujpaa5jIeCRLLEoMRCj2LM7aTD0BJ4D9rjUpOguALeMDjXuRFpPG0V2bRBR5yX
|
31
|
+
FgoLpkThWNwOrjTqmnXnJSQcOJTJaTZkXuY/vXI/AcN7aGbDi8gifgvvS6Umju+z
|
32
|
+
VFSVwtQuPhU4ruToRGUseXOsPwwWnJPleiEX5RQOIJ4mGmHzx5FnoDYNlHkS8DTT
|
33
|
+
K+77PgOz8oMDmzrQlCx1FDWhgNqsImrLYcca7kcoINTasLWmvfz1xaBeP4MdCk0R
|
34
|
+
CUaImqpeG21iNKLYHcNZkGfepUpp4FHudbeQeaJj8R5ug+f402l7T4s3JCAOcVIY
|
35
|
+
MqZAStuHt2H1iR+JVSpFx1kkRJncIjtSnxUFd4MsBT083aOme9H/J+tb/YA=
|
36
36
|
-----END CERTIFICATE-----
|
37
|
-
date:
|
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.
|
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.
|
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.
|
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.
|
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
|