aws-sdk-core 3.48.1 → 3.48.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b891c54e431955f5815edc5ac83b72a95006af5d
4
- data.tar.gz: aa345a6c3e6bb2646d2e58197ff36f8490aaabf7
3
+ metadata.gz: 034e75b026117775fbfac82dd511e32920dbc85e
4
+ data.tar.gz: d50869c480038a5e136e1f94d0d7fab5c2de3ba4
5
5
  SHA512:
6
- metadata.gz: 3c2a0d382e00bc2b0fc057fe4c1bea3eb00dc68040897c3aa79c2bedb82630636a69982abc1fc44b599a7039c59aebaf6d6490ff736b184d57c75dd8951d8e8f
7
- data.tar.gz: b87a3d703e433d7d2041a9b96aaecda9a80e14354080eb8bf3acca83b3c9dc838abc4a25c0e511cd22dbcdeb0bde07f6d274a0a19093d97a90f4a9b5cc67fc80
6
+ metadata.gz: 1fa04a470f284a8579910c0f27b70be2d581e70d1da1cf5611494c66f2851c29147cb2a7e9c76301ddda090c63db5dfe78a7fc6023f18b0fbee432854b9e25fa
7
+ data.tar.gz: 5c3c37c461e39cebb07be4947922b9fe1bb426204d44b552925b21207d438b945d7759b925186c27c16cdac3a1eee97e54567dc5c5175c9b4263e70d97136e65
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.48.1
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
- # events need to be send in order
36
- # every event signature requries prior signature
37
- thread = Thread.new do
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
 
@@ -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
- @buffer = Queue.new
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
- attr_reader :buffer
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
- @buffer << Proc.new do
31
- if @validate_event && type != :end_stream
32
- Aws::ParamValidator.validate!(
33
- @encoder.rules.shape.member(type), params)
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
- class Queue
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
@@ -40,6 +40,6 @@ require_relative 'aws-sdk-sts/customizations'
40
40
  # @service
41
41
  module Aws::STS
42
42
 
43
- GEM_VERSION = '3.48.1'
43
+ GEM_VERSION = '3.48.2'
44
44
 
45
45
  end
@@ -1535,7 +1535,7 @@ module Aws::STS
1535
1535
  params: params,
1536
1536
  config: config)
1537
1537
  context[:gem_name] = 'aws-sdk-core'
1538
- context[:gem_version] = '3.48.1'
1538
+ context[:gem_version] = '3.48.2'
1539
1539
  Seahorse::Client::Request.new(handlers, context)
1540
1540
  end
1541
1541
 
@@ -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.1
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-19 00:00:00.000000000 Z
11
+ date: 2019-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jmespath