Skip to content

Commit

Permalink
feat: bump version to 1.0.2
Browse files Browse the repository at this point in the history
fix: use Aws::Query::ParamList::IoWrapper#read when building an async buffered body
  • Loading branch information
Julien D committed Jun 14, 2020
1 parent 2c2483d commit c9e1067
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 37 deletions.
6 changes: 5 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
async-aws (1.0.1)
async-aws (1.0.2)
async-http (~> 0.51)

GEM
Expand Down Expand Up @@ -39,6 +39,9 @@ GEM
aws-sdk-core (~> 3, >= 3.83.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sdk-sqs (1.24.0)
aws-sdk-core (~> 3, >= 3.71.0)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.1.1)
aws-eventstream (~> 1.0, >= 1.0.2)
console (1.8.2)
Expand Down Expand Up @@ -76,6 +79,7 @@ DEPENDENCIES
async-aws!
aws-sdk-dynamodb
aws-sdk-s3
aws-sdk-sqs
bundler (~> 2.0)
rake (~> 13.0)
rspec (~> 3.0)
Expand Down
1 change: 1 addition & 0 deletions async-aws.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "aws-sdk-s3"
spec.add_development_dependency "aws-sdk-dynamodb"
spec.add_development_dependency "aws-sdk-sqs"
spec.add_development_dependency "async"
end
2 changes: 1 addition & 1 deletion lib/async/aws/http_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def call(context)
k == 'host' || k == 'content-length'
end
)
buffered_body = Async::HTTP::Body::Buffered.wrap(req.body)
buffered_body = Async::HTTP::Body::Buffered.wrap(req.body.read)
request = ::Protocol::HTTP::Request.new(
client.scheme, endpoint.authority, req.http_method, endpoint.path,
nil, headers, buffered_body
Expand Down
2 changes: 1 addition & 1 deletion lib/async/aws/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Async
module Aws
VERSION = '1.0.1'
VERSION = '1.0.2'
end
end
34 changes: 0 additions & 34 deletions spec/async/aws_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,4 @@
end
expect(handler_klass).not_to be_nil
end

it 'should send an async request to AWS' do
Async::Reactor.run do |reactor|
tasks = 10.times.collect do
s3 = Aws::S3::Client.new
Async do
bench = Async::Clock.measure do
result = s3.list_buckets
expect(result.is_a?(Seahorse::Client::Response)).to be(true)
end
end
end

tasks.each(&:wait)
end
end

it 'should work with DynamoDB' do
Async::Reactor.run do |reactor|
task = Async do
dynamo = Aws::DynamoDB::Client.new
dynamo.get_item(
table_name: 'async-aws-rspec',
key: { pk: 'test' }
)
dynamo.get_item(
table_name: 'async-aws-rspec',
key: { pk: 'test' }
)
end

task.wait
end
end
end
20 changes: 20 additions & 0 deletions spec/async/dynamodb_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
require 'async/aws/all'

Async::Aws.configure(connection_limit: 4)

RSpec.describe Async::Aws do
it 'should execute dynamodb:GetItem action' do
Async::Reactor.run do |reactor|
task = Async do
dynamo = Aws::DynamoDB::Client.new
result = dynamo.get_item(
table_name: 'async-aws-rspec',
key: { pk: 'test' }
)
expect(result.data).to be_kind_of(Aws::DynamoDB::Types::GetItemOutput)
end

task.wait
end
end
end
18 changes: 18 additions & 0 deletions spec/async/s3_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'async/aws/all'

Async::Aws.configure(connection_limit: 4)

RSpec.describe Async::Aws do
it 'should execute s3:ListBuckets action' do
Async::Reactor.run do
s3 = Aws::S3::Client.new

task = Async do
result = s3.list_buckets
expect(result.data).to be_kind_of(Aws::S3::Types::ListBucketsOutput)
end

task.wait
end
end
end
17 changes: 17 additions & 0 deletions spec/async/sqs_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require 'async/aws/all'

Async::Aws.configure(connection_limit: 4)

RSpec.describe Async::Aws do
it 'should execute sqs:ListQueues action' do
Async::Reactor.run do
task = Async do
sqs = Aws::SQS::Client.new
result = sqs.list_queues
expect(result.data).to be_kind_of(Aws::SQS::Types::ListQueuesResult)
end

task.wait
end
end
end
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require "bundler/setup"
require 'aws-sdk-s3'
require 'aws-sdk-dynamodb'
require 'aws-sdk-sqs'
require 'async'
require 'async/clock'
require 'async/http'
Expand Down

0 comments on commit c9e1067

Please sign in to comment.