Ruby on Rails Friday, December 23, 2011

Yes, this make sense, but this is only one case from a lots of other
possibilities. For example, we can reduce the request time by fetching
user and post in parallel, like this:

user, post = [
Thread.new{User.by_id request.cookies[:user_id]},
Thread.new{Post.by_id params[:id]}
].collect(&:value)

Although in this case, there's probably maybe some issues with MySQL
driver (more exactly with its C extension).
But in the case of HTTP requests (for CouchDB for example) this should
work.
But for some reasons nobody uses such technics.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment