Asynchronously iterating over the response of a request using Thin and Sinatra?

So in the end, I found out that the example did indeed work and I could eventually get Sinatra to stream each-able results concurrently, primarily using the EM. Defer idea in Pusher and Async page. Curl and Apache benchmarking confirmed that this was working The reason why it didn't work in the browser is because browsers limit the number of connections to the same URL.

I was aware of there being a limit to concurrent connections to a single domain (also a low number), but not that (seemingly) all connections to a single URI are serialized: maillist.caucho.com/pipermail/resin-inte... I don't know if this is configurable, I only see domain-wide configuration in Firefox, but that was the issue.

So in the end, I found out that the example did indeed work and I could eventually get Sinatra to stream each-able results concurrently, primarily using the EM. Defer idea in Pusher and Async page. Curl and Apache benchmarking confirmed that this was working.

The reason why it didn't work in the browser is because browsers limit the number of connections to the same URL. I was aware of there being a limit to concurrent connections to a single domain (also a low number), but not that (seemingly) all connections to a single URI are serialized: maillist.caucho.com/pipermail/resin-inte... I don't know if this is configurable, I only see domain-wide configuration in Firefox, but that was the issue.

When you are about to handle the response of the object do this: fork do handle request... exit 99 end and if you don't need to do not wait for this child process to end.. with a: child = fork do handle request... exit 99 end Process. Detach(child) It's a simple way to handle multiple requests, however I am not sure what ORM you may be using for those DB queries, but you could get into table/row level locking problems with multiple processes trying to hit the db, if that is what you mean when you say handling requests...

The problem isn't asynchronously handling the DB requests, it's asynchronously returning the Sinatra responses to the client. I know that EventMachine will allow you to defer a proc and have a callback proc to execute when the deferred code is complete. The DB in question is MongoDB, by the way, and we have a cursor to the returned results.

The problem is to tell Sinatra to iterate over cursors concurrently and generate responses from independent cursors concurrently. – Kenny Peng Oct 17 '10 at 2:24.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions