Async/test/config.tasks.php
Abel Hoogeveen d42e7f23ef
All checks were successful
continuous-integration/drone/push Build is passing
Implemented proper dependencies.
Dependencies can now pass output to each other using the DependentTaskHandler.
Also fixed some general problems in the Tasks class, for instance the Executor not starting correctly because of problematic parameters.
Also, SuperVisor now sets the output of a Task using the last output of the task, and not the first.
2020-06-05 15:23:21 +02:00

92 lines
3.6 KiB
PHP

<?php
/**
* FuzeWorks Async Library
*
* The FuzeWorks PHP FrameWork
*
* Copyright (C) 2013-2020 TechFuze
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @author TechFuze
* @copyright Copyright (c) 2013 - 2020, TechFuze. (http://techfuze.net)
* @license https://opensource.org/licenses/MIT MIT License
*
* @link http://techfuze.net/fuzeworks
* @since Version 1.0.0
*
* @version Version 1.0.0
*/
use FuzeWorks\Core;
/**
* Contains all the configuration, including docker environment variables.
*/
return array(
// Add a file lock
'lock' => true,
// Which SuperVisor should be used, and with what settings
'SuperVisor' => [
'type' => Core::getEnv('SUPERVISOR_TYPE', 'ParallelSuperVisor'),
'ParallelSuperVisor' => ['parameters' => []]
],
// Which TaskStorage should be used, and with what settings
'TaskStorage' => [
'type' => Core::getEnv('TASKSTORAGE_TYPE', 'DummyTaskStorage'),
'DummyTaskStorage' => ['parameters' => []],
'ArrayTaskStorage' => [
'parameters' => [
'filename' => Core::getEnv('TASKSTORAGE_ARRAY_FILE',
dirname(__FILE__) . DS . 'temp'. DS . 'storage.php')
]
],
'RedisTaskStorage' => [
'parameters' => [
// Type can be 'tcp' or 'unix'
'socket_type' => Core::getEnv('TASKSTORAGE_REDIS_SOCKET_TYPE', 'tcp'),
// If socket_type == 'unix', set the socket here
'socket' => Core::getEnv('TASKSTORAGE_REDIS_SOCKET', null),
// If socket_type == 'tcp', set the host here
'host' => Core::getEnv('TASKSTORAGE_REDIS_HOST', '127.0.0.1'),
// And some standard settings
'password' => Core::getEnv('TASKSTORAGE_REDIS_PASSWORD', null),
'port' => Core::getEnv('TASKSTORAGE_REDIS_PORT', 6379),
'timeout' => Core::getEnv('TASKSTORAGE_REDIS_TIMEOUT', 0),
'db_index' => Core::getEnv('TASKSTORAGE_REDIS_DBINDEX', 0),
]
],
],
// Which Executor should be used, and with what settings
'Executor' => [
'type' => Core::getEnv('EXECUTOR_TYPE', 'ShellExecutor'),
'ShellExecutor' => [
'parameters' => [
'workerFile' => Core::getEnv('EXECUTOR_SHELL_WORKER',
dirname(__FILE__, 2) . DS . 'bin' . DS . 'worker'),
'bootstrapFile' => Core::getEnv('EXECUTOR_SHELL_BOOTSTRAP',
dirname(__FILE__) . DS . 'bootstrap.php')
]
]
]
);