-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from Pharaonic/executor-pool
Feat: enable create multiple pools of executors
- Loading branch information
Showing
4 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace Pharaonic\Laravel\Executor\Classes; | ||
|
||
class ExecutorPoolClass | ||
{ | ||
/** | ||
* These paths for all pools of executors. | ||
*/ | ||
private array $paths = []; | ||
|
||
public function __construct() | ||
{ | ||
$this->paths = [ | ||
base_path('executors'), | ||
]; | ||
} | ||
|
||
/** | ||
* Return all pools of executors. | ||
* | ||
* @return array | ||
*/ | ||
public function getPaths(): array | ||
{ | ||
return $this->paths; | ||
} | ||
|
||
/** | ||
* Add a new path to executors pools. | ||
* | ||
* @param string $path | ||
* | ||
* @return void | ||
*/ | ||
public function addPath(string $path): void | ||
{ | ||
array_push($this->paths, $path); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Pharaonic\Laravel\Executor\Facades; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
class ExecutorPool extends Facade | ||
{ | ||
protected static function getFacadeAccessor() | ||
{ | ||
return 'pharaonic.executor.executorPool'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters