aws-sdk-core 3.48.1 → 3.48.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/aws-sdk-core/binary/decode_handler.rb +3 -15
- data/lib/aws-sdk-core/errors.rb +4 -0
- data/lib/aws-sdk-core/event_emitter.rb +24 -24
- data/lib/aws-sdk-sts.rb +1 -1
- data/lib/aws-sdk-sts/client.rb +1 -1
- data/lib/seahorse/client/async_response.rb +0 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 034e75b026117775fbfac82dd511e32920dbc85e
|
4
|
+
data.tar.gz: d50869c480038a5e136e1f94d0d7fab5c2de3ba4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fa04a470f284a8579910c0f27b70be2d581e70d1da1cf5611494c66f2851c29147cb2a7e9c76301ddda090c63db5dfe78a7fc6023f18b0fbee432854b9e25fa
|
7
|
+
data.tar.gz: 5c3c37c461e39cebb07be4947922b9fe1bb426204d44b552925b21207d438b945d7759b925186c27c16cdac3a1eee97e54567dc5c5175c9b4263e70d97136e65
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.48.
|
1
|
+
3.48.2
|
@@ -32,21 +32,9 @@ module Aws
|
|
32
32
|
context.http_response.body,
|
33
33
|
output_handler)
|
34
34
|
if input_emitter = context[:input_event_emitter]
|
35
|
-
#
|
36
|
-
#
|
37
|
-
|
38
|
-
# polling for buffered emit events until stream not active
|
39
|
-
while input_emitter.stream.state == :open
|
40
|
-
while callback = input_emitter.buffer.shift
|
41
|
-
callback.call if input_emitter.stream.state == :open
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
thread.abort_on_exception = true
|
46
|
-
# attach thread to current stream context
|
47
|
-
# make sure when stream closes (#wait or #join! is called)
|
48
|
-
# input signal thread is also killed
|
49
|
-
context[:input_signal_thread] = thread
|
35
|
+
# #emit will be blocked until 200 success
|
36
|
+
# see Aws::EventEmitter#emit
|
37
|
+
input_emitter.signal_queue << "ready"
|
50
38
|
end
|
51
39
|
end
|
52
40
|
|
data/lib/aws-sdk-core/errors.rb
CHANGED
@@ -58,6 +58,10 @@ module Aws
|
|
58
58
|
|
59
59
|
end
|
60
60
|
|
61
|
+
# Raised when attempting to #signal an event before
|
62
|
+
# making an async request
|
63
|
+
class SignalEventError < RuntimeError; end
|
64
|
+
|
61
65
|
# Raised when EventStream Parser failed to parse
|
62
66
|
# a raw event message
|
63
67
|
class EventStreamParserError < RuntimeError; end
|
@@ -4,7 +4,8 @@ module Aws
|
|
4
4
|
def initialize
|
5
5
|
@listeners = {}
|
6
6
|
@validate_event = true
|
7
|
-
@
|
7
|
+
@status = :sleep
|
8
|
+
@signal_queue = Queue.new
|
8
9
|
end
|
9
10
|
|
10
11
|
attr_accessor :stream
|
@@ -13,7 +14,7 @@ module Aws
|
|
13
14
|
|
14
15
|
attr_accessor :validate_event
|
15
16
|
|
16
|
-
|
17
|
+
attr_accessor :signal_queue
|
17
18
|
|
18
19
|
def on(type, callback)
|
19
20
|
(@listeners[type] ||= []) << callback
|
@@ -27,35 +28,34 @@ module Aws
|
|
27
28
|
end
|
28
29
|
|
29
30
|
def emit(type, params)
|
30
|
-
@
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
end
|
35
|
-
@stream.data(
|
36
|
-
@encoder.encode(type, params),
|
37
|
-
end_stream: type == :end_stream
|
31
|
+
unless @stream
|
32
|
+
raise Aws::Errors::SignalEventError.new(
|
33
|
+
"Singaling events before making async request"\
|
34
|
+
" is not allowed."
|
38
35
|
)
|
39
36
|
end
|
37
|
+
if @validate_event && type != :end_stream
|
38
|
+
Aws::ParamValidator.validate!(
|
39
|
+
@encoder.rules.shape.member(type), params)
|
40
|
+
end
|
41
|
+
_ready_for_events?
|
42
|
+
@stream.data(
|
43
|
+
@encoder.encode(type, params),
|
44
|
+
end_stream: type == :end_stream
|
45
|
+
)
|
40
46
|
end
|
41
47
|
|
42
48
|
private
|
43
49
|
|
44
|
-
|
45
|
-
|
46
|
-
def initialize(procs = [])
|
47
|
-
@procs = procs
|
48
|
-
@mutex = Mutex.new
|
49
|
-
end
|
50
|
-
|
51
|
-
def <<(callback)
|
52
|
-
@mutex.synchronize { @procs << callback }
|
53
|
-
end
|
54
|
-
|
55
|
-
def shift
|
56
|
-
@mutex.synchronize { @procs.shift }
|
57
|
-
end
|
50
|
+
def _ready_for_events?
|
51
|
+
return true if @status == :ready
|
58
52
|
|
53
|
+
# blocked until once initial 200 response is received
|
54
|
+
# signal will be available in @signal_queue
|
55
|
+
# and this check will no longer be blocked
|
56
|
+
@signal_queue.pop
|
57
|
+
@status = :ready
|
58
|
+
true
|
59
59
|
end
|
60
60
|
|
61
61
|
end
|
data/lib/aws-sdk-sts.rb
CHANGED
data/lib/aws-sdk-sts/client.rb
CHANGED
@@ -41,7 +41,6 @@ module Seahorse
|
|
41
41
|
@stream_mutex.synchronize {
|
42
42
|
@close_condition.wait(@stream_mutex)
|
43
43
|
}
|
44
|
-
_kill_input_thread
|
45
44
|
@response
|
46
45
|
end
|
47
46
|
end
|
@@ -54,20 +53,10 @@ module Seahorse
|
|
54
53
|
# for the "sync_signal"
|
55
54
|
@sync_queue << "sync_signal"
|
56
55
|
@stream.close
|
57
|
-
_kill_input_thread
|
58
56
|
@response
|
59
57
|
end
|
60
58
|
end
|
61
59
|
|
62
|
-
private
|
63
|
-
|
64
|
-
def _kill_input_thread
|
65
|
-
if thread = context[:input_signal_thread]
|
66
|
-
Thread.kill(thread)
|
67
|
-
end
|
68
|
-
nil
|
69
|
-
end
|
70
|
-
|
71
60
|
end
|
72
61
|
end
|
73
62
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.48.
|
4
|
+
version: 3.48.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jmespath
|