Hey,
When i am running mysql query with q:wait(), the server freezes and in result, it crashes. Is there someway i can create another thread that if it would freeze it wont affect server?
Thanks!
[QUOTE=Noi;48579912]You better use callbacks for this, lua is not threaded.[/QUOTE]
Can you provide me an example?
[QUOTE=SteppuFIN;48579922]Can you provide me an example?[/QUOTE]
[url]http://facepunch.com/showthread.php?t=1357773[/url]
[CODE]-- Callbacks
Query.onAborted( q )
-- Called when the query is aborted.
Query.onError( q, err, sql )
-- Called when the query errors, [String] err is the error and [String] sql is the SQL query that caused it.
Query.onSuccess( q, data )
-- Called when the query is successful, [Table] data is the data the query returned.
Query.onData( q, data )
-- Called when the query retrieves a row of data, [Table] data is the row.[/CODE]
[QUOTE=InfernusN;48579945][url]http://facepunch.com/showthread.php?t=1357773[/url]
[CODE]-- Callbacks
Query.onAborted( q )
-- Called when the query is aborted.
Query.onError( q, err, sql )
-- Called when the query errors, [String] err is the error and [String] sql is the SQL query that caused it.
Query.onSuccess( q, data )
-- Called when the query is successful, [Table] data is the data the query returned.
Query.onData( q, data )
-- Called when the query retrieves a row of data, [Table] data is the row.[/CODE][/QUOTE]
Well how would i return the result from function which is in function?
[QUOTE=SteppuFIN;48580016]Well how would i return the result from function which is in function?[/QUOTE]
It works same as hooks.
Sorry, you need to Log In to post a reply to this thread.