Skip to content

Commit

Permalink
Merge branch 'threading_fix' of https://github.com/tobias/aws into to…
Browse files Browse the repository at this point in the history
…bias-threading_fix

Conflicts:
	lib/acf/right_acf_interface.rb
	lib/ec2/right_ec2.rb
	lib/ec2/right_mon_interface.rb
	lib/sqs/right_sqs_interface.rb
  • Loading branch information
Travis Reeder committed Dec 13, 2010
2 parents b288fec + f088dbd commit b66f299
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
5 changes: 2 additions & 3 deletions lib/acf/right_acf_interface.rb
Expand Up @@ -141,9 +141,8 @@ def generate_request(method, path, body=nil, headers={}) # :nodoc:
# Sends request to Amazon and parses the response.
# Raises AwsError if any banana happened.
def request_info(request, parser, options={}, &block) # :nodoc:
thread = @params[:multi_thread] ? Thread.current : Thread.main
thread[:acf_connection] ||= Rightscale::HttpConnection.new(:exception => Aws::AwsError, :logger => @logger)
request_info_impl(thread[:acf_connection], @@bench, request, parser, options, &block)
conn = get_conn(:acf_connection, @params, @logger)
request_info_impl(conn, @@bench, request, parser, options, &block)
end

#-----------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions lib/ec2/right_ec2.rb
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2007-2008 RightScale Inc
#
Expand Down Expand Up @@ -161,9 +162,8 @@ def generate_request(action, params={}) #:nodoc:
# Sends request to Amazon and parses the response
# Raises AwsError if any banana happened
def request_info(request, parser, options={}) #:nodoc:
thread = @params[:multi_thread] ? Thread.current : Thread.main
thread[:ec2_connection] ||= Rightscale::HttpConnection.new(:exception => AwsError, :logger => @logger)
request_info_impl(thread[:ec2_connection], @@bench, request, parser, options)
conn = get_conn(:ec2_connection, @params, @logger)
request_info_impl(conn, @@bench, request, parser, options)
end

def hash_params(prefix, list) #:nodoc:
Expand Down
5 changes: 2 additions & 3 deletions lib/ec2/right_mon_interface.rb
Expand Up @@ -80,9 +80,8 @@ def generate_request(action, params={})
# Sends request to Amazon and parses the response
# Raises AwsError if any banana happened
def request_info(request, parser, options={})
thread = @params[:multi_thread] ? Thread.current : Thread.main
thread[:elb_connection] ||= Rightscale::HttpConnection.new(:exception => Aws::AwsError, :logger => @logger)
request_info_impl(thread[:elb_connection], @@bench, request, parser, options)
conn = get_conn(:mon_connection, @params, @logger)
request_info_impl(conn, @@bench, request, parser, options)
end

#-----------------------------------------------------------------
Expand Down
6 changes: 2 additions & 4 deletions lib/sqs/right_sqs_interface.rb
Expand Up @@ -141,12 +141,10 @@ def generate_post_request(action, param={}) # :nodoc:
# Sends request to Amazon and parses the response
# Raises AwsError if any banana happened
def request_info(request, parser, options={}) # :nodoc:
thread = @params[:multi_thread] ? Thread.current : Thread.main
thread[:sqs_connection] ||= Rightscale::HttpConnection.new(:exception => AwsError, :logger => @logger)
request_info_impl(thread[:sqs_connection], @@bench, request, parser, options)
conn = get_conn(:sqs_connection, @params, @logger)
request_info_impl(conn, @@bench, request, parser, options)
end


# Creates a new queue, returning its URI.
#
# sqs.create_queue('my_awesome_queue') #=> 'http://queue.amazonaws.com/ZZ7XXXYYYBINS/my_awesome_queue'
Expand Down

0 comments on commit b66f299

Please sign in to comment.