Global

Members


length

返回管道的数量(不包括基本管道)

queueFull

队列是否有位置

ram

判断线程池是否开放

Methods


clean()

清理过期的线程
Returns:
是否有过期的线程被清理
Type
Boolean

close()

关闭线程池,start不会再生成线程
Returns:
this

closeExit()

关闭队列出口
Returns:
this

closeQueue()

关闭队列入口
Returns:
this

emptyQueue()

清空队列
Returns:
this

emptyThreads()

清空线程池,但不会阻断执行中的线程
Returns:
this

end(callback [, hand])

结束管道 callback(ctx)
Parameters:
Name Type Argument Default Description
callback function
hand Object <optional>
this.options.hand 函数指向的this
Returns:
this

error(callback [, hand])

抛错管道 callback(error, ctx, next, close)
Parameters:
Name Type Argument Default Description
callback function
hand Object <optional>
this.options.hand 函数指向的this
Returns:
this

fail(callback [, hand])

失败管道 callback(ctx, next, close)
Parameters:
Name Type Argument Default Description
callback function
hand Object <optional>
this.options.hand
Returns:
this

inspect()

判断线程池是否满员,满员则清除失活的线程
Returns:
Type
Boolean

onFull(callback [, hand])

线程池溢满事件 callback(ctx, FocusFlow)
Parameters:
Name Type Argument Default Description
callback function 回调函数
hand Object <optional>
this.options.hand this
Returns:
this

onQueueFull(callback [, hand])

队列溢满事件 callback(ctx, FocusFlow)
Parameters:
Name Type Argument Default Description
callback function 回调函数
hand Object <optional>
this.options.hand this
Returns:
this

open()

打开线程池
Returns:
this

openExit()

打开队列出口
Returns:
this

openQueue()

打开队列入口
Returns:
this

start(ctx, sign)

执行管道流
Parameters:
Name Type Description
ctx any object上下文内容|any管道标记
sign any object上下文内容|any管道标记
Returns:
this

success(callback [, hand])

成功管道 callback(ctx, next, close)
Parameters:
Name Type Argument Default Description
callback function
hand Object <optional>
this.options.hand 函数指向的this
Returns:
this

use(sign, callback [, hand])

收集管道 callback(ctx, next, close)
Parameters:
Name Type Argument Default Description
sign String | function | FocusFlow 标记|回调函数|FocusFlow实例,用来合并管道函数
callback function | Object 回调函数|函数this
hand Object <optional>
this.options.hand
Returns:
this