MySQL
#7

Threading means that the plugin will go and run the query while allowing your script to resume execution.
Scenario:
You have two servers running the same gamemode, but using a MySQL server to store common data. In this case we will be handling player house data. You want this data to be loaded into the game mode all the time so that if a player buys a house on server A, server B will also show the house icon. Well if you're running a fairly popular server then you will end up having a lot of housing data. You want this data synchronized about every minute (for purpose of this example), however this is causing much lag while the plugin is going to the MySQL server to fetch the data. The script is waiting for the plugin to get the data before it can do anything else. So player updates are frozen during this time.
This is where threaded queries would help out. If you were to launch a threaded query to fetch the house data the plugin would run the query, while allowing the script to execute. Once the query has ran and the plugin has all the data, it will execute the specified callback in the script. Once this callback gets executed then your script will get all the data from the query, and you can process it as efficiently as you can.
Any questions?
Reply


Messages In This Thread
MySQL - by x96664 - 25.08.2013, 20:19
Re: MySQL - by ViruZz - 25.08.2013, 22:57
Re: MySQL - by Scenario - 25.08.2013, 23:05
Re: MySQL - by x96664 - 26.08.2013, 00:01
Re: MySQL - by PaulDinam - 26.08.2013, 00:24
Re: MySQL - by -Prodigy- - 26.08.2013, 02:15
Re: MySQL - by dowster - 26.08.2013, 02:46
Re: MySQL - by Scenario - 26.08.2013, 04:07
Re: MySQL - by x96664 - 26.08.2013, 06:53
Re: MySQL - by dowster - 27.08.2013, 01:58

Forum Jump:


Users browsing this thread: 1 Guest(s)