Class: Aws::Kinesis::AsyncClient
- Inherits:
-
Seahorse::Client::AsyncBase
- Object
- Seahorse::Client::AsyncBase
- Aws::Kinesis::AsyncClient
- Includes:
- AsyncClientStubs
- Defined in:
- lib/aws-sdk-kinesis/async_client.rb,
sig/async_client.rbs
Overview
An API async client for Kinesis. To construct an async client, you need to configure a :region and :credentials.
async_client = Aws::Kinesis::AsyncClient.new(
region: region_name,
credentials: credentials,
# ...
)
For details on configuring region and credentials see the developer guide.
See #initialize for a full list of supported configuration options.
Defined Under Namespace
Modules: _SubscribeToShardResponseSuccess
Class Attribute Summary collapse
- .identifier ⇒ Object readonly private
API Operations collapse
-
#subscribe_to_shard(params = {}) ⇒ Types::SubscribeToShardOutput
This operation establishes an HTTP/2 connection between the consumer you specify in the
ConsumerARNparameter and the shard you specify in theShardIdparameter.
Class Method Summary collapse
- .errors_module ⇒ Object private
- .new ⇒ Object
Instance Method Summary collapse
- #build_request(operation_name, params = {}) ⇒ Object private
-
#initialize(options) ⇒ AsyncClient
constructor
A new instance of AsyncClient.
Constructor Details
#initialize(options) ⇒ AsyncClient
Returns a new instance of AsyncClient.
410 411 412 413 414 415 |
# File 'lib/aws-sdk-kinesis/async_client.rb', line 410 def initialize(*args) unless Kernel.const_defined?("HTTP2") raise "Must include http/2 gem to use AsyncClient instances." end super end |
Class Attribute Details
.identifier ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
772 773 774 |
# File 'lib/aws-sdk-kinesis/async_client.rb', line 772 def identifier @identifier end |
Class Method Details
.errors_module ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
775 776 777 |
# File 'lib/aws-sdk-kinesis/async_client.rb', line 775 def errors_module Errors end |
.new ⇒ Object
14 |
# File 'sig/async_client.rbs', line 14
def self.new: (
|
Instance Method Details
#build_request(operation_name, params = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 |
# File 'lib/aws-sdk-kinesis/async_client.rb', line 735 def build_request(operation_name, params = {}) handlers = @handlers.for(operation_name) tracer = config.telemetry_provider.tracer_provider.tracer( Aws::Telemetry.module_to_tracer_name('Aws::Kinesis') ) context = Seahorse::Client::RequestContext.new( operation_name: operation_name, operation: config.api.operation(operation_name), client: self, params: params, http_response: Seahorse::Client::Http::AsyncResponse.new, config: config, tracer: tracer ) context[:gem_name] = 'aws-sdk-kinesis' context[:gem_version] = '1.103.0' Seahorse::Client::Request.new(handlers, context) end |
#subscribe_to_shard(params = {}) ⇒ Types::SubscribeToShardOutput
This operation establishes an HTTP/2 connection between the consumer
you specify in the ConsumerARN parameter and the shard you specify
in the ShardId parameter. After the connection is successfully
established, Kinesis Data Streams pushes records from the shard to the
consumer over this connection. Before you call this operation, call
RegisterStreamConsumer to register the consumer with Kinesis Data
Streams.
When the SubscribeToShard call succeeds, your consumer starts
receiving events of type SubscribeToShardEvent over the HTTP/2
connection for up to 5 minutes, after which time you need to call
SubscribeToShard again to renew the subscription if you want to
continue to receive records.
You can make one call to SubscribeToShard per second per registered
consumer per shard. For example, if you have a 4000 shard stream and
two registered stream consumers, you can make one SubscribeToShard
request per second for each combination of shard and registered
consumer, allowing you to subscribe both consumers to all 4000 shards
in one second.
If you call SubscribeToShard again with the same ConsumerARN and
ShardId within 5 seconds of a successful call, you'll get a
ResourceInUseException. If you call SubscribeToShard 5 seconds or
more after a successful call, the second call takes over the
subscription and the previous connection expires or fails with a
ResourceInUseException.
For an example of how to use this operation, see Enhanced Fan-Out Using the Kinesis Data Streams API.
76 |
# File 'sig/async_client.rbs', line 76
def subscribe_to_shard: (
|