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

Public Member Functions

 run ()
 
 isWorking ()
 
 stopRunning ()
 
 quit ()
 
 addQuery (int $queryId, int $mode, string $query, array $params)
 
 readResults (array &$callbacks)
 
 connCreated ()
 
 hasConnError ()
 
 getConnError ()
 
- Public Member Functions inherited from SqlThread
 join ()
 

Protected Member Functions

 createConn (&$resource)
 
 executeQuery ($resource, int $mode, string $query, array $params)
 
 close (&$resource)
 

Protected Attributes

 $slaveNumber
 
 $bufferSend
 
 $bufferRecv
 
 $connCreated = false
 
 $connError
 
 $working = false
 

Additional Inherited Members

- Data Fields inherited from SqlThread
const MODE_GENERIC = 0
 
const MODE_CHANGE = 1
 
const MODE_INSERT = 2
 
const MODE_SELECT = 3
 

Detailed Description

Definition at line 37 of file SqlSlaveThread.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

Implements SqlThread.

Definition at line 106 of file SqlSlaveThread.php.

◆ close()

close ( $resource)
abstractprotected

◆ connCreated()

connCreated ( )

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

Returns
bool

Implements SqlThread.

Definition at line 121 of file SqlSlaveThread.php.

◆ createConn()

createConn ( $resource)
abstractprotected

◆ executeQuery()

executeQuery (   $resource,
int  $mode,
string  $query,
array  $params 
)
abstractprotected
Parameters
mixed$resource
int$mode
string$query
mixed[]$params
Returns
SqlResult
Exceptions
SqlError

◆ getConnError()

getConnError ( )

Gets the error of the initial connection.

Returns
null|string

Implements SqlThread.

Definition at line 129 of file SqlSlaveThread.php.

◆ hasConnError()

hasConnError ( )

Checks if the initial connection failed.

Returns
bool

Implements SqlThread.

Definition at line 125 of file SqlSlaveThread.php.

◆ isWorking()

isWorking ( )

Returns true if this thread is working, false if waiting for requests

Returns
bool

Definition at line 94 of file SqlSlaveThread.php.

◆ quit()

quit ( )

Definition at line 102 of file SqlSlaveThread.php.

◆ readResults()

readResults ( array &  $callbacks)

Handles the results that this query has completed

Parameters
callable[]$callbacks

Implements SqlThread.

Definition at line 110 of file SqlSlaveThread.php.

◆ run()

run ( )

Definition at line 63 of file SqlSlaveThread.php.

◆ stopRunning()

stopRunning ( )

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

Implements SqlThread.

Definition at line 98 of file SqlSlaveThread.php.

Field Documentation

◆ $bufferRecv

$bufferRecv
protected

Definition at line 43 of file SqlSlaveThread.php.

◆ $bufferSend

$bufferSend
protected

Definition at line 42 of file SqlSlaveThread.php.

◆ $connCreated

$connCreated = false
protected

Definition at line 44 of file SqlSlaveThread.php.

◆ $connError

$connError
protected

Definition at line 45 of file SqlSlaveThread.php.

◆ $slaveNumber

$slaveNumber
protected

Definition at line 41 of file SqlSlaveThread.php.

◆ $working

$working = false
protected

Definition at line 46 of file SqlSlaveThread.php.


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