Have you try node-pool module.?
On Dec 27, 2012 11:31 AM, "Andrey" <andrey.sido...@gmail.com> wrote:

> In addition to all previous posts:
>
> Note that mysql protocol is synchronous (you can't send next query before
> receiving result from previous) and all mysql clients queue commands in
> some way. Unless you have two separate connections from pool you can safely
> do
>
> mysql.query("one big query");
> mysql.query("second big query").on('end', render);
>
> - this way render is called only after both queries are finished.
>
>
> On Wednesday, 26 December 2012 04:14:27 UTC+11, Joman Sierra wrote:
>>
>> I have this scenario:
>>
>> function one
>> {
>> Makes a query to a big mysql table
>>
>> }
>>
>> Function two
>> {
>> Makes another query to a big myslq table
>> }
>>
>> res.render(showing results of the queries)
>>
>>
>> The problem is that when render is executed the mysql queries are still
>> in progress.  What's the best way to be sure that the functions has
>> finished before sending the render?
>>
>  --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to