Skip to content

Commit 32420e1

Browse files
committed
update
1 parent 3320dc9 commit 32420e1

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Intro
22
lightweight and powerful task load balancing for php
33

4-
> like the nginx load balancing :)
4+
> like the `nginx` load balancing :)
55
66
# Features
77

@@ -99,7 +99,7 @@ run the task, and return a result array.
9999

100100
The $opts value:
101101
* $opts['data']
102-
* $opts['agent']
102+
* $opts['driver']
103103

104104
### $task->data($data)
105105

@@ -232,7 +232,6 @@ $task->beforeRun(function($task, $preReturn, $index, $handlers){
232232
- [x] remember every driver`s start time and end time.
233233
- [x] smart parse arguments of method `driver()`.
234234
- [x] task lifecycle and hooks
235-
- [ ] use `backup:n` to set backup drivers order.
236235
- [ ] remove driver and add new driver.
237236
- [ ] pause/resume task
238237

src/TaskBalancer/Balancer.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ public static function run($name = '', array $opts = [])
5252
if (isset($opts['data'])) {
5353
$task->data($opts['data']);
5454
}
55-
$agentName = isset($opts['agent']) ? $opts['agent'] : '';
56-
$results = $task->run((String) $agentName);
55+
$driverName = isset($opts['driver']) ?
56+
$opts['driver'] : (isset($opts['agent']) ?
57+
$opts['agent'] : '');
58+
$results = $task->run((String) $driverName);
5759
$task->reset();
5860
return $results;
5961
}

0 commit comments

Comments
 (0)