本文整理匯總了TypeScript中aws-sdk.Kinesis類的典型用法代碼示例。如果您正苦於以下問題:TypeScript Kinesis類的具體用法?TypeScript Kinesis怎麽用?TypeScript Kinesis使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Kinesis類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: Kinesis
export const createKinesisClient = (conf: ClientConfig, endpoint?: string): Kinesis => {
const instance = new Kinesis(conf || {})
if (endpoint) {
instance.setEndpoint(endpoint)
}
return instance
}
示例2: Promise
return new Promise(function(resolve, reject) {
Kinesis.putRecord(kinesisRequest, function (error: any, data: any) {
if (error) return reject(error);
console.log("Successfully put to ExactTargetStatus stream with SequenceNumber of " + data.SequenceNumber);
return resolve(data);
});
})
示例3: done
const next = done => {
const params = {
StreamName: stream,
ExclusiveStartShardId: startShardId,
}
client.describeStream(params, (err, data) => {
if (err) {
return done(err)
}
if (!data.StreamDescription.HasMoreShards) {
foundAllShards = true
}
const lastShard = data.StreamDescription.Shards[data.StreamDescription.Shards.length - 1]
startShardId = lastShard.ShardId
shards = shards.concat(data.StreamDescription.Shards)
done()
})
}
示例4: describe
private describe(callback) {
this.kinesis.describeStream({ StreamName: this.name }, callback)
}