I have a Ruby on Rails app. Ruby 2.3 Rails 3.2 The app uses resque which runs jobs asynchronously off a queue. One job, in particular, makes calls to an external (Ebay) api. While the api call is being made, the CPU of the ec2 instance doesn’t process anything. Is there a way to prevent the CPU from going idle during the api call?
2
Answers
Here's a solution I came up with which is working so far. I realize this question tends to offend peoples' sensibilities. But, perhaps with the caveat that this code should never actually be executed, I'd be interested to know of any potential shortcomings:
Yes absolutely. In fact its trivial:
This will just continue printing a Matrix screensaver indefinately without blocking until you call
t.exit
.But its most likely the wrong answer to the wrong question.