Class: Aws::SageMakerRuntime::EventStreams::ResponseStream

Inherits:
Object
  • Object
show all
Defined in:
gems/aws-sdk-sagemakerruntime/lib/aws-sdk-sagemakerruntime/event_streams.rb

Instance Method Summary collapse

Constructor Details

#initializeResponseStream

Returns a new instance of ResponseStream.



14
15
16
# File 'gems/aws-sdk-sagemakerruntime/lib/aws-sdk-sagemakerruntime/event_streams.rb', line 14

def initialize
  @event_emitter = Aws::EventEmitter.new
end

Instance Method Details

#on_error_event(&block) ⇒ Object



30
31
32
# File 'gems/aws-sdk-sagemakerruntime/lib/aws-sdk-sagemakerruntime/event_streams.rb', line 30

def on_error_event(&block)
  @event_emitter.on(:error, block) if block_given?
end

#on_event(&block) ⇒ Object



42
43
44
45
46
47
48
49
# File 'gems/aws-sdk-sagemakerruntime/lib/aws-sdk-sagemakerruntime/event_streams.rb', line 42

def on_event(&block)
  on_payload_part_event(&block)
  on_model_stream_error_event(&block)
  on_internal_stream_failure_event(&block)
  on_error_event(&block)
  on_initial_response_event(&block)
  on_unknown_event(&block)
end

#on_initial_response_event(&block) ⇒ Object



34
35
36
# File 'gems/aws-sdk-sagemakerruntime/lib/aws-sdk-sagemakerruntime/event_streams.rb', line 34

def on_initial_response_event(&block)
  @event_emitter.on(:initial_response, block) if block_given?
end

#on_internal_stream_failure_event(&block) ⇒ Object



26
27
28
# File 'gems/aws-sdk-sagemakerruntime/lib/aws-sdk-sagemakerruntime/event_streams.rb', line 26

def on_internal_stream_failure_event(&block)
  @event_emitter.on(:internal_stream_failure, block) if block_given?
end

#on_model_stream_error_event(&block) ⇒ Object



22
23
24
# File 'gems/aws-sdk-sagemakerruntime/lib/aws-sdk-sagemakerruntime/event_streams.rb', line 22

def on_model_stream_error_event(&block)
  @event_emitter.on(:model_stream_error, block) if block_given?
end

#on_payload_part_event(&block) ⇒ Object



18
19
20
# File 'gems/aws-sdk-sagemakerruntime/lib/aws-sdk-sagemakerruntime/event_streams.rb', line 18

def on_payload_part_event(&block)
  @event_emitter.on(:payload_part, block) if block_given?
end

#on_unknown_event(&block) ⇒ Object



38
39
40
# File 'gems/aws-sdk-sagemakerruntime/lib/aws-sdk-sagemakerruntime/event_streams.rb', line 38

def on_unknown_event(&block)
  @event_emitter.on(:unknown_event, block) if block_given?
end