Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6814871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:44:24+00:00 2026-05-26T20:44:24+00:00

I want to display some Amazon products, loaded via Ajax. I call the method

  • 0

I want to display some Amazon products, loaded via Ajax.

I call the method below with Ajax, but the request takes a couple of seconds.

@items = []
@shows.shuffle.first(5).each do |show|
    req = AmazonProduct["us"]
    req.configure do |c|
      c.key = "###"
      c.secret = "###"
      c.tag = "###"
    end
    req << { :operation => 'ItemSearch',
             :search_index => params[:product_type],
             :response_group => %w{ItemAttributes Images},
             :keywords => show.name,
             :sort => "" }
    resp = req.get
    @items << resp.find('Item').shuffle.first
end

I’ve nothiced that this Action blocks the server. I’ve tried having the site open in another tab. That tab won’t start loading until the first tab with the Ajax call completes.

How can I go about solving this problem?


Setup:

Ubuntu 10.10
Rails 3.1.1
Ruby 1.9.2
Gem: https://github.com/hakanensari/amazon_product

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:44:25+00:00Added an answer on May 26, 2026 at 8:44 pm

    EDIT:

    Just to clarify, it depends on the server you use in your development environment, it’s not rails.

    WebRick (default http server in dev) can only handle one request at the time. When you deploy your application you should use puma, unicorn, Phusion Passenger, or any other server that has more than one process (or thread) handling your requests.

    OLD Answer:

    I don’t think this is possible in rails.

    The way how I would approach this problem is to create a simple sinatra-synchrony app that has only action for fetching products that you want from amazon.

    To be able to send ajax request to this app, you need to point this app to your domain (subdomain).

    I don’t see any other solution, at the moment. Of course you can have more than one application process on your server, but this will not solve your problem in long term.

    So to wrap up:

    AJAX -> amazon-producs-sinatra-app.yourdomain.com 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to display some text from server, but till then I want to
I want to display some properties of a (custom) Label in its Tooltip, but
I want to display some QTextEdits over my main window at arbitrary locations. Below
Ok, So I want to display some attributes, but only if they have a
I want to display some data that relates to products like the ebay styles
I want to display some text below each grid image. Please see my code
My request is quite simple: I just want to display some text at a
I want to display some data on table, let's call it TabeView app. So
I want to display some images but, at the of that, I would like
I am new to sencha touch2. i want to display some text labels below

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.