libasynql
3.2.0
Asynchronous MySQL access library for PocketMine plugins.
|
Public Member Functions | |
__construct (callable $workerFactory, int $workerLimit) | |
join () | |
stopRunning () | |
addQuery (int $queryId, int $mode, string $query, array $params) | |
readResults (array &$callbacks) | |
connCreated () | |
hasConnError () | |
getConnError () | |
getLoad () | |
Additional Inherited Members | |
Data Fields inherited from SqlThread | |
const | MODE_GENERIC = 0 |
const | MODE_CHANGE = 1 |
const | MODE_INSERT = 2 |
const | MODE_SELECT = 3 |
Definition at line 29 of file SqlThreadPool.php.
__construct | ( | callable | $workerFactory, |
int | $workerLimit | ||
) |
SqlThreadPool constructor.
callable | $workerFactory | create a child worker: function(?Threaded $bufferSend = null, ?Threaded $bufferRecv = null) : BaseSqlThread{} |
int | $workerLimit | the maximum number of workers to create. Workers are created lazily. |
Definition at line 47 of file SqlThreadPool.php.
addQuery | ( | int | $queryId, |
int | $mode, | ||
string | $query, | ||
array | $params | ||
) |
Adds a query to the queue.
int | $queryId | |
int | $mode | |
string | $query | |
mixed[] | $params |
Implements SqlThread.
Definition at line 71 of file SqlThreadPool.php.
connCreated | ( | ) |
Checks if the initial connection has been made, no matter successful or not.
Implements SqlThread.
Definition at line 96 of file SqlThreadPool.php.
getConnError | ( | ) |
Gets the error of the initial connection.
Implements SqlThread.
Definition at line 104 of file SqlThreadPool.php.
getLoad | ( | ) |
Definition at line 108 of file SqlThreadPool.php.
hasConnError | ( | ) |
Checks if the initial connection failed.
Implements SqlThread.
Definition at line 100 of file SqlThreadPool.php.
join | ( | ) |
Joins the thread
Implements SqlThread.
Definition at line 59 of file SqlThreadPool.php.
readResults | ( | array & | $callbacks | ) |
Handles the results that this query has completed
callable[] | $callbacks |
Implements SqlThread.
Definition at line 85 of file SqlThreadPool.php.
stopRunning | ( | ) |
Signals the thread to stop waiting for queries when the send buffer is cleared.
Implements SqlThread.
Definition at line 65 of file SqlThreadPool.php.