you don't want to use synchronous requests because this will block your whole module with all users until the sql for one user has returned.
and in the idea of cadrach for instance:

while(sqlFinished === false)
{
//waiting loop
}

is horrible, this could use up to 100% cpu only for one user, able to slow down your whole server just for one single SQL request. there's a reason why there is no sleep-function in javascript.

get used to asynchronous handling. send the cmd result to the client when it is available and make the client work with this. in my rails+ape+mysql-example you'll find a way how you could this, take a look at it:http://flip.netzbeben.de/2010/01/howto-create-a-web-chat-with-ape-rails-and-mysql/

flip


Am 13.01.2010 17:28, schrieb nouknouk:
Hi,

I'm currently trying to use MySQL from server side Javascript
framework and I face two issues:

1/ the MySQL binding works in an asynchronous way. But this can be
annoying if you want for example to make a MySQL request into a
command code : as MySQL query is asynchronous, you cannot directly
send a 'command response' to the command sent by the client.

Is there any way to force the use of MySQL binding in an synchronous
way and thus avoid the need to send a 'command response' immediatly,
plus a second raw just after which contains the result of my query.



-- 
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/

Reply via email to