Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to send targeted company shares #191

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ismell
Copy link
Contributor

@ismell ismell commented Dec 9, 2013

This introduces a breaking change to the add_company_share method. We
now parse the response body so the user does not have to parse the xml
response body. This change should not impact many users seeing as the
add_company_share method was just added a while ago and there hasn't
been a release since.

Usage:

response = client.add_company_share("2414183", {
  :comment => "Testing, 1, 2, 3",
  :targets => {
    :geos => ['as', 'eu'],
    :jobFunc => ['acct', 'bd']
  }
puts "ID: #{response.body.update_key}"
puts "URL: #{response.body.update_url}"

This introduces a breaking change to the add_company_share method. We
now parse the response body so the user does not have to parse the xml
response body. This change should not impact many users seeing as the
add_company_share method was just added a while ago and there hasn't
been a release since.

Usage:

    response = client.add_company_share("2414183", {
      :comment => "Testing, 1, 2, 3",
      :targets => {
        :geos => ['as', 'eu'],
        :jobFunc => ['acct', 'bd']
      }
    puts "ID: #{response.body.update_key}"
    puts "URL: #{response.body.update_url}"

define_method :load_template do |template|
return cache[template] if cache[template]
mutex.synchronize do
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During your testing did you run into race conditions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any time I modify a shared variable I want to make sure it's serialized. Though in this case if multiple threads read and compile the same template it's not really the end of the world.

@ismell
Copy link
Contributor Author

ismell commented Dec 12, 2013

Thanks for the awesome code review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants