@@ -40,7 +40,7 @@ $result = Balancer::run('task1');
4040
4141# Method
4242
43- 1 . Balancer::task($taskName, [ $data, ] $work);
43+ ## # 1 . Balancer::task($taskName, [ $data, ] $work);
4444
4545create a task instance, return task instance.
4646
@@ -50,15 +50,17 @@ Balancer::task('taskName', $data, function($task){
5050});
5151```
5252
53- 2 . Balancer::run($taskName)
53+ ** note:** ` $data ` will store in task instance.
54+
55+ ###2 . Balancer::run($taskName)
5456
5557run the task, return a results array.
5658
57- 3 . $task->driver($optionString, [ $weight, 'backup', ] $work);
59+ ## # 3 . $task->driver($optionString, [ $weight, 'backup', ] $work);
5860
5961create a driver instance for ` $task ` , return driver instance.
6062
61- ** note:** $weight must be a integer
63+ ** note:** ` $weight ` must be a integer
6264
6365``` php
6466$task->driver('driverName 80 backup', function($driver, $data){
@@ -67,45 +69,50 @@ $task->driver('driverName 80 backup', function($driver, $data){
6769});
6870```
6971
70- 4 . $driver->weight($weight)
72+ ## # 4 . $driver->weight($weight)
7173
7274set driver`s weight, return current driver,
7375supported chain operation.
7476
75- ** note:** $weight must be a integer
77+ ** note:** ` $weight ` must be a integer
7678
77- 5 . $driver->backup($is)
79+ ## # 5 . $driver->backup($is)
7880
7981set driver is backup, return current driver,
8082supported chain operation.
8183
82- ** note:** $is must be true of false
84+ ** note:** ` $is ` must be true of false
8385
84- 6 . $driver->data($data);
86+ ## # 6 . $driver->data($data);
8587
8688set data for driver`s work use,
8789support chain operation.
8890
89- 7 . $driver->work(function($driver, $data){});
91+ ** note:** ` $data ` will store in driver instance.
92+
93+ ###7 . $driver->work(function($driver, $data){});
9094
91- set driver`s work, give two arguments: $driver and $data,
95+ set driver` s work, give two arguments: ` $driver` and ` $data` ,
9296support chain operation.
9397
94- 8 . $driver->failed()
98+ ** note:** ` $data ` is try to get from driver instance,
99+ if null will continue try to get from task instance.
100+
101+ ###8 . $driver->failed()
95102
96103set current driver run failed,
97104support chain operation.
98105
99- 9 . $driver->success()
106+ ## # 9 . $driver->success()
100107
101108set current driver run successful.
102109support chain operation.
103110
104- 10 . $driver->getDriverData()
111+ ## # 10 . $driver->getDriverData()
105112
106113get data from driver.
107114
108- 11 . $driver->getTaskData()
115+ ## # 11 . $driver->getTaskData()
109116
110117get data from task.
111118
0 commit comments