From 4385ab2701de7cf413d2acda23b4a86df219052d Mon Sep 17 00:00:00 2001 From: toplan Date: Mon, 7 Dec 2015 22:49:39 +0800 Subject: [PATCH] update readme --- README.md | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f8f58b2..ca8fde0 100644 --- a/README.md +++ b/README.md @@ -162,7 +162,11 @@ get data value of task instance. ## 2. Task Lifecycle -| Hook name | handler arguments | handler return value | +> support multiple handlers for every hook! + +###Hooks Table + +| Hook name | handler arguments | influence of the last handler`s return value | | --------- | :----------------: | :-----: | | beforeCreateDriver | $task, $preReturn, $index | no effect | | afterCreateDriver | $task, $preReturn, $index | no effect | @@ -171,21 +175,24 @@ get data value of task instance. | afterDriverRun | $task, $preReturn, $index | no effect | | afterRun | $task, $results, $preReturn, $index | if not boolean will override result value | -### $task->hook($hookName, $handler, $override) +###Use Hooks + +> `$override` default value is `false`, if `true` will override hook handlers. + +* $task->hook($hookName, $handler, $override) -### $task->beforeCreateDriver($handler, $override) +* $task->beforeCreateDriver($handler, $override) -### $task->afterCreateDriver($handler, $override) +* $task->afterCreateDriver($handler, $override) -### $task->beforeRun($handler, $override) +* $task->beforeRun($handler, $override) -### $task->beforeDriverRun($handler, $override) +* $task->beforeDriverRun($handler, $override) -### $task->afterDriverRun($handler, $override) +* $task->afterDriverRun($handler, $override) -### $task->afterRun($handler, $override) +* $task->afterRun($handler, $override) -> `$override` default value is `false`, if `true` will override hooks handler. ```php //example