MySQL R7
#1

Hello,

I'm using BlueG's MySQL R7 Plugin and have one question left over. It has been mentioned that all queries are now threaded. Does that mean that I can do the following and just keep coding below it as it will just not wait for MySQL to finish?:

pawn Код:
// Would this cause any issues (e.g. lag)?
mysql_function_query(handle, "INSERT INTO `table` (`column`) VALUES ('value')", false, "" "");
SetPlayerPos(/* ... */);
GetPlayerPos(/* ... */);
PutPlayerInVehicle(/* ... */);
// ...
I hope you understand my question - as in R6 I used OnQueryFinish to continue my code as it would await the finish of the query before doing anything else.
Reply
#2

Yes, the mysql_function_query only puts your query to some queue and awaits for it execution, which is apart from the PAWN VM and runs in its own thread. Any code below mysql_function_query gets executed as it should, meaning no delay..
Oh, and by the way, if you haven't already, you should check this tutorial for all vitally explained differences from R6 to R7:
https://sampforum.blast.hk/showthread.php?tid=337810
Reply
#3

Quote:
Originally Posted by Virtual1ty
Посмотреть сообщение
Yes, the mysql_function_query only puts your query to some queue and awaits for it execution, which is apart from the PAWN VM and runs in its own thread. Any code below mysql_function_query gets executed as it should, meaning no delay..
Oh, and by the way, if you haven't already, you should check this tutorial for all vitally explained differences from R6 to R7:
https://sampforum.blast.hk/showthread.php?tid=337810
Thanks, and yeah, I already did check it out but I was unsure about this tiny detail so I better asked. So the only thing I got to take care now is that when I need a result of the query that I then need to use the callbacks.
Reply
#4

Yes, when you want to do something with the returned set (if any) you must use callbacks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)