# \PG\MSF\CoroutineMySql

Class MySql

## Summary

Methods
Properties
Constants
__construct()
getResult()
throwTimeOutException()
isTimeout()
nextRun()
destroy()
__unsleep()
breakx()
setTimeout()
send()
$maxTimeout
$request
$result
$timeout
$requestTime
$responseTime
$ioBack
$ioBackKey
$isBreak
$requestId
$mysqlAsynPool
$bindId
$sql
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

File
  Coroutine/MySql.php
Package
  MSF\Coroutine
Class hierarchy
  \PG\MSF\Coroutine\Base
  \PG\MSF\Coroutine\MySql

## Tags

None found

## Properties

### $maxTimeout

    $maxTimeout : integer

#### Type

integer — 协程运行的最大超时时间

#

Inherited from
  \PG\MSF\Coroutine\Base

## Tags

None found

### $request

    $request : string

#### Type

string — 请求参数

#

Inherited from
  \PG\MSF\Coroutine\Base

## Tags

None found

### $result

    $result : mixed

#### Type

mixed — IO协程运行的结束

#

Inherited from
  \PG\MSF\Coroutine\Base

## Tags

None found

### $timeout

    $timeout : integer

#### Type

integer — 协程执行的超时时间精确到ms

#

Inherited from
  \PG\MSF\Coroutine\Base

## Tags

None found

### $requestTime

    $requestTime : float

#### Type

float — 协程执行请求开始时间

#

Inherited from
  \PG\MSF\Coroutine\Base

## Tags

None found

### $responseTime

    $responseTime : float

#### Type

float — 协程执行请求结束时间

#

Inherited from
  \PG\MSF\Coroutine\Base

## Tags

None found

### $ioBack

    $ioBack : boolean

#### Type

boolean — IO协程是否返回数据

#

Inherited from
  \PG\MSF\Coroutine\Base

## Tags

None found

### $ioBackKey

    $ioBackKey : integer|null

#### Type

integer|null — ioBack标识

#

Inherited from
  \PG\MSF\Coroutine\Base

## Tags

None found

### $isBreak

    $isBreak : boolean

#### Type

boolean — 是否发送异步请求后不需要执行回调

#

Inherited from
  \PG\MSF\Coroutine\Base

## Tags

None found

### $requestId

    $requestId : string|null

#### Type

string|null — 整个请求标识

#

Inherited from
  \PG\MSF\Coroutine\Base

## Tags

None found

### $mysqlAsynPool

    $mysqlAsynPool : \PG\MSF\Pools\MysqlAsynPool

#### Type

\PG\MSF\Pools\MysqlAsynPool — MySQL连接池对象

#

## Tags

None found

### $bindId

    $bindId : string|null

#### Type

string|null — 绑定ID

#

## Tags

None found

### $sql

    $sql : string|null

#### Type

string|null — 执行的SQL

#

## Tags

None found

## Methods

### __construct()

    __construct(\PG\MSF\Pools\MysqlAsynPool  $_mysqlAsynPool, integer|null  $_bind_id = null, string|null  $_sql = null)

MySql constructor.

#### Parameters

\PG\MSF\Pools\MysqlAsynPool | $_mysqlAsynPool | MySQL连接池对象
integer|null | $_bind_id | bind ID
string|null | $_sql | 执行的SQL

#

## Tags

None found

### getResult()

    getResult() : mixed|null

获取执行结果

#### Throws

\Exception

#### Returns

mixed|null

#

## Tags

None found

### throwTimeOutException()

    throwTimeOutException()

协程超时异常

#### Throws

\Exception

#

Inherited from
  \PG\MSF\Coroutine\Base

## Tags

None found

### isTimeout()

    isTimeout() : boolean

判断协程是否超时

#### Returns

boolean

#

Inherited from
  \PG\MSF\Coroutine\Base

## Tags

None found

### nextRun()

    nextRun() : boolean

通知调度器进行下一次迭代

#### Returns

boolean

#

Inherited from
  \PG\MSF\Coroutine\Base

## Tags

None found

### destroy()

    destroy()

销毁

#

## Tags

None found

### __unsleep()

    __unsleep() : array

属性不用于序列化

#### Returns

array

#

## Tags

None found

### breakx()

    breakx() : boolean

发送异步请求后不需要执行回调

#### Returns

boolean

#

Inherited from
  \PG\MSF\Coroutine\Base

## Tags

None found

### setTimeout()

    setTimeout(integer  $timeout) : $this

手工设置超时时间

#### Parameters

integer | $timeout | 超时时间，单位毫秒

#### Returns

$this

#

Inherited from
  \PG\MSF\Coroutine\Base

## Tags

None found

### send()

    send(callable  $callback)

发送异步的MySQL请求

#### Parameters

callable | $callback | 执行SQL后的回调函数

#

## Tags

None found

### MySql.php