Posts: 56
Threads: 14
Joined: Oct 2014
Reputation:
0
is tquery faster or safer?
sometime I dont want use tquery, beacause I dont need a callback or I just want query it and use it inline.
sorry for bad english, THX to replies.
Posts: 521
Threads: 20
Joined: Jan 2016
Reputation:
0
i don't know what you mean but safer it's faster
Posts: 2,203
Threads: 154
Joined: Oct 2009
Reputation:
0
Im myself using old R6 plugin with mysql_query_callback, so answer is based on what i read in wiki.
Mysql qeury will wait for response before continuing further, while tquery will be executed in another thread, code will continue and when mysql server send response it will be passed to callback.
Basically tquery is better for performance as it will be threaded. Simple example is, you send mysql_query to mysql server, it takes 5 seconds to respond (lets say huge lag or something), in that 5 seconds until mysql server responds or plugin decides that request has timed out your server will be stuck and not doing anything, not even updating players positions and such...meaning players would see server lag. While with tquery, after calling that function, server continues with executing his code, and when mysql server responds you get all info in a callback.
Posts: 319
Threads: 7
Joined: Jul 2012
Reputation:
0
That would be a good idea, never thought of that.
Try it and find out if it works.
My guess is that it would work just fine.