# \PG\MSF\ControllersBench

Class Bench

## Summary

Methods
Properties
Constants
__construct()
getObjectPool()
setObjectPool()
setRequestType()
getRequestType()
onExceptionHandle()
destroy()
output()
outputJson()
outputView()
__sleep()
__unsleep()
getServerInstance()
getConfig()
getPack()
getRedisPool()
getMysqlPool()
getRedisProxy()
setRedisPools()
setRedisProxies()
isUse()
getIsDestroy()
setContext()
actionRedisPoolSet()
actionRedisPoolGet()
actionRedisGetCallBack()
actionHttpCallBack()
actionHttpCoroutine()
$objectPoolBuckets
$requestStartTime
$requestType
$__useCount
$__genTime
$__isContruct
$stdClass
No constants found
No protected methods found
$objectPool
$__isDestroy
$redisPools
$mysqlPools
$redisProxies
$reflections
N/A
No private methods found
$client
N/A

File
  Controllers/Bench.php
Package
  MSF\Controllers
Class hierarchy
  \PG\MSF\Base\Child
  \PG\MSF\Base\Core
  \PG\MSF\Controllers\Controller
  \PG\MSF\Controllers\Bench

## Tags

None found

## Properties

### $objectPoolBuckets

    $objectPoolBuckets : array

#### Type

array — 当前请求已使用的对象列表

#

Inherited from
  \PG\MSF\Controllers\Controller

## Tags

None found

### $requestStartTime

    $requestStartTime : float

#### Type

float — 请求开始处理的时间

#

Inherited from
  \PG\MSF\Controllers\Controller

## Tags

None found

### $requestType

    $requestType : string

#### Type

string — TCP_REQUEST|HTTP_REQUEST 请求类型

#

Inherited from
  \PG\MSF\Controllers\Controller

## Tags

None found

### $__useCount

    $__useCount : integer

#### Type

integer — 作用计数

#

Inherited from
  \PG\MSF\Base\Core

## Tags

None found

### $__genTime

    $__genTime : integer

#### Type

integer — 创建时间

#

Inherited from
  \PG\MSF\Base\Core

## Tags

None found

### $__isContruct

    $__isContruct : boolean

#### Type

boolean — 是否执行构造方法

#

Inherited from
  \PG\MSF\Base\Core

## Tags

None found

### $stdClass

    $stdClass : \stdClass|null

#### Type

\stdClass|null — 对象模板

#

Inherited from
  \PG\MSF\Base\Core

## Tags

None found

### $objectPool

    $objectPool : \PG\AOP\Wrapper|\PG\MSF\Base\Pool

#### Type

\PG\AOP\Wrapper|\PG\MSF\Base\Pool — 对象池

#

Inherited from
  \PG\MSF\Controllers\Controller

## Tags

None found

### $__isDestroy

    $__isDestroy : boolean

#### Type

boolean — 销毁标志

#

Inherited from
  \PG\MSF\Base\Core

## Tags

None found

### $redisPools

    $redisPools : array

#### Type

array — redis连接池

#

Inherited from
  \PG\MSF\Base\Core

## Tags

None found

### $mysqlPools

    $mysqlPools : array

#### Type

array — mysql连接池

#

Inherited from
  \PG\MSF\Base\Core

## Tags

None found

### $redisProxies

    $redisProxies : array

#### Type

array — redis代理池

#

Inherited from
  \PG\MSF\Base\Core

## Tags

None found

### $reflections

    $reflections : array

#### Type

array — 反射类属性的默认值

#

Inherited from
  \PG\MSF\Base\Child

## Tags

None found

### $client

    $client :

#### Type

#

## Tags

None found

## Methods

### __construct()

    __construct()

构造方法

#

Inherited from
  \PG\MSF\Base\Core

## Tags

None found

### getObjectPool()

    getObjectPool() : \PG\AOP\Wrapper|\PG\MSF\Base\Pool

获取对象池

#### Returns

\PG\AOP\Wrapper|\PG\MSF\Base\Pool

#

Inherited from
  \PG\MSF\Controllers\Controller

## Tags

None found

### setObjectPool()

    setObjectPool(\PG\AOP\Wrapper|\PG\MSF\Base\Pool|NULL  $objectPool) : $this

设置对象池

#### Parameters

\PG\AOP\Wrapper|\PG\MSF\Base\Pool|NULL | $objectPool | Pool实例

#### Returns

$this

#

Inherited from
  \PG\MSF\Controllers\Controller

## Tags

None found

### setRequestType()

    setRequestType(string  $requestType) : $this

设置请求类型

#### Parameters

string | $requestType | TCP_REQUEST|HTTP_REQUEST

#### Returns

$this

#

Inherited from
  \PG\MSF\Controllers\Controller

## Tags

None found

### getRequestType()

    getRequestType() : string

返回请求类型

#### Returns

string

#

Inherited from
  \PG\MSF\Controllers\Controller

## Tags

None found

### onExceptionHandle()

    onExceptionHandle(\Throwable  $e)

异常的回调

#### Parameters

\Throwable | $e | 异常实例

#### Throws

\Throwable

#

Inherited from
  \PG\MSF\Controllers\Controller

## Tags

None found

### destroy()

    destroy()

销毁,解除引用

#

Inherited from
  \PG\MSF\Base\Child

## Tags

None found

### output()

    output(mixed|null  $data = null, integer  $status = 200) : void

响应原始数据

#### Parameters

mixed|null | $data | 响应数据
integer | $status | 响应HTTP状态码

#

Inherited from
  \PG\MSF\Controllers\Controller

## Tags

None found

### outputJson()

    outputJson(mixed|null  $data = null, integer  $status = 200) : void

响应json格式数据

#### Parameters

mixed|null | $data | 响应数据
integer | $status | 响应HTTP状态码

#

Inherited from
  \PG\MSF\Controllers\Controller

## Tags

None found

### outputView()

    outputView(array  $data, string|null  $view = null) : void

通过模板引擎响应输出HTML

#### Parameters

array | $data | 待渲染KV数据
string|null | $view | 文件名

#### Throws

\Exception
\Throwable
\Exception

#

Inherited from
  \PG\MSF\Controllers\Controller

## Tags

None found

### __sleep()

    __sleep() : array

在序列化及dump对象时使用，代表哪些属于需要导出

#### Returns

array

#

Inherited from
  \PG\MSF\Base\Core

## Tags

None found

### __unsleep()

    __unsleep()

和__sleep作用相反

#

Inherited from
  \PG\MSF\Base\Core

## Tags

None found

### getServerInstance()

    getServerInstance() : \swoole_server

获取运行Server实例

#### Returns

\swoole_server

#

Inherited from
  \PG\MSF\Base\Core

## Tags

None found

### getConfig()

    getConfig() : \Noodlehaus\Config

获取运行server实例配置对象

#### Returns

\Noodlehaus\Config

#

Inherited from
  \PG\MSF\Base\Core

## Tags

None found

### getPack()

    getPack() : \PG\MSF\Pack\IPack

获取运行server实例打包对象

#### Returns

\PG\MSF\Pack\IPack

#

Inherited from
  \PG\MSF\Base\Core

## Tags

None found

### getRedisPool()

    getRedisPool(string  $poolName) : boolean|\PG\AOP\Wrapper|\PG\MSF\Pools\CoroutineRedisProxy|\Redis

获取Redis连接池

#### Parameters

string | $poolName | 配置的Redis连接池名称

#### Returns

boolean|\PG\AOP\Wrapper|\PG\MSF\Pools\CoroutineRedisProxy|\Redis

#

Inherited from
  \PG\MSF\Base\Core

## Tags

None found

### getMysqlPool()

    getMysqlPool(string  $poolName) : boolean|\PG\AOP\Wrapper

获取MySQL连接池

#### Parameters

string | $poolName | 配置的MySQL连接池名称

#### Returns

boolean|\PG\AOP\Wrapper

#

Inherited from
  \PG\MSF\Base\Core

## Tags

None found

### getRedisProxy()

    getRedisProxy(string  $proxyName) : boolean|\PG\AOP\Wrapper|\PG\MSF\Pools\CoroutineRedisProxy|\Redis

获取Redis代理

#### Parameters

string | $proxyName | 配置的Redis代理名称

#### Throws

\Exception

#### Returns

boolean|\PG\AOP\Wrapper|\PG\MSF\Pools\CoroutineRedisProxy|\Redis

#

Inherited from
  \PG\MSF\Base\Core

## Tags

None found

### setRedisPools()

    setRedisPools(array|null  $redisPools) : $this

设置RedisPools

#### Parameters

array|null | $redisPools | 多个Redis连接池实例，通常用于销毁Redis连接池，赋值为NULL

#### Returns

$this

#

Inherited from
  \PG\MSF\Base\Core

## Tags

None found

### setRedisProxies()

    setRedisProxies(array|null  $redisProxies) : $this

设置RedisPools

#### Parameters

array|null | $redisProxies | 多个Redis代理实例，通常用于销毁Redis代理，赋值为NULL

#### Returns

$this

#

Inherited from
  \PG\MSF\Base\Core

## Tags

None found

### isUse()

    isUse()

对象已使用标识

#

Inherited from
  \PG\MSF\Base\Core

## Tags

None found

### getIsDestroy()

    getIsDestroy() : boolean

是否已经执行destroy

#### Returns

boolean

#

Inherited from
  \PG\MSF\Base\Core

## Tags

None found

### setContext()

    setContext(\PG\MSF\Helpers\Context  $context) : $this

设置上下文

#### Parameters

\PG\MSF\Helpers\Context | $context | 请求上下文对象

#### Returns

$this

#

Inherited from
  \PG\MSF\Base\Child

## Tags

None found

### actionRedisPoolSet()

    actionRedisPoolSet()

#

## Tags

None found

### actionRedisPoolGet()

    actionRedisPoolGet()

#

## Tags

None found

### actionRedisGetCallBack()

    actionRedisGetCallBack()

#

## Tags

None found

### actionHttpCallBack()

    actionHttpCallBack()

#

## Tags

None found

### actionHttpCoroutine()

    actionHttpCoroutine()

#

## Tags

None found

### Bench.php