Skip to content

Commit

Permalink
update code
Browse files Browse the repository at this point in the history
  • Loading branch information
toplan committed Nov 20, 2015
1 parent 5db8f6a commit 6f558ea
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ create a task instance, return task instance.

```php
Balancer::task('taskName', $data, function($task){
//task`s work
//task init work
});
```

Expand Down
6 changes: 0 additions & 6 deletions src/TaskBalancer/Balancer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ class Balancer {
*/
protected static $tasks = [];

/**
* running task instances
* @var array
*/
protected static $runningTasks = [];

/**
* create a task instance
* @param $name
Expand Down
4 changes: 2 additions & 2 deletions src/TaskBalancer/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public static function create(Task $task, $name, $weight = 1, $isBackUp = false,
* before run driver work
* @return bool
*/
private function beforeRun()
protected function beforeRun()
{
$this->time['started_at'] = microtime();
return true;
Expand Down Expand Up @@ -123,7 +123,7 @@ public function run()
*
* @return mixed
*/
private function afterRun($result)
protected function afterRun($result)
{
$this->time['finished_at'] = microtime();
return $result;
Expand Down
4 changes: 2 additions & 2 deletions src/TaskBalancer/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function run($driverName = '')
* before run task
* @return bool
*/
private function beforeRun()
protected function beforeRun()
{
$pass = $this->callHookHandler('beforeRun');
if ($pass) {
Expand All @@ -173,7 +173,7 @@ private function beforeRun()
*
* @return mixed
*/
private function afterRun($success)
protected function afterRun($success)
{
$this->status = static::FINISHED;
$this->time['finished_at'] = microtime();
Expand Down

0 comments on commit 6f558ea

Please sign in to comment.