libasynql  3.2.0
Asynchronous MySQL access library for PocketMine plugins.
SqlThread Interface Reference
Inheritance diagram for SqlThread:
SqlSlaveThread SqlThreadPool MysqliThread Sqlite3Thread

Public Member Functions

 join ()
 
 stopRunning ()
 
 addQuery (int $queryId, int $mode, string $query, array $params)
 
 readResults (array &$callbacks)
 
 connCreated ()
 
 hasConnError ()
 
 getConnError ()
 

Data Fields

const MODE_GENERIC = 0
 
const MODE_CHANGE = 1
 
const MODE_INSERT = 2
 
const MODE_SELECT = 3
 

Detailed Description

Definition at line 25 of file SqlThread.php.

Member Function Documentation

◆ addQuery()

addQuery ( int  $queryId,
int  $mode,
string  $query,
array  $params 
)

Adds a query to the queue.

Parameters
int$queryId
int$mode
string$query
mixed[]$params

Implemented in SqlSlaveThread, and SqlThreadPool.

◆ connCreated()

connCreated ( )

Checks if the initial connection has been made, no matter successful or not.

Returns
bool

Implemented in SqlSlaveThread, and SqlThreadPool.

◆ getConnError()

getConnError ( )

Gets the error of the initial connection.

Returns
null|string

Implemented in SqlSlaveThread, and SqlThreadPool.

◆ hasConnError()

hasConnError ( )

Checks if the initial connection failed.

Returns
bool

Implemented in SqlSlaveThread, and SqlThreadPool.

◆ join()

join ( )

Joins the thread

See also
https://php.net/thread.join Thread::join

Implemented in SqlThreadPool.

◆ readResults()

readResults ( array &  $callbacks)

Handles the results that this query has completed

Parameters
callable[]$callbacks

Implemented in SqlSlaveThread, and SqlThreadPool.

◆ stopRunning()

stopRunning ( )

Signals the thread to stop waiting for queries when the send buffer is cleared.

Implemented in SqlSlaveThread, and SqlThreadPool.

Field Documentation

◆ MODE_CHANGE

const MODE_CHANGE = 1

Definition at line 27 of file SqlThread.php.

◆ MODE_GENERIC

const MODE_GENERIC = 0

Definition at line 26 of file SqlThread.php.

◆ MODE_INSERT

const MODE_INSERT = 2

Definition at line 28 of file SqlThread.php.

◆ MODE_SELECT

const MODE_SELECT = 3

Definition at line 29 of file SqlThread.php.


The documentation for this interface was generated from the following file: