-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdaemon_redis.php
More file actions
25 lines (19 loc) · 780 Bytes
/
daemon_redis.php
File metadata and controls
25 lines (19 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
use DataSift\TestBundle\Task\DummyTask;
use DataSift\TestBundle\Daemon\Daemon;
use \Zend\Config\Reader\Ini;
use \DataSift\TestBundle\Log\Logger\FileLogger;
use \DataSift\TestBundle\Server\Redis\RedisServer;
use \DataSift\TestBundle\Task\RedisTask;
require 'autoloader.php';
require 'vendor/autoload.php';
date_default_timezone_set('Europe/London');
$configIni = new Ini();
$config = $configIni->fromFile('app/config/config.ini');
$logger = new FileLogger($config['production']['path_log_file']);
$redis = new Redis();
$redis->connect($config['production']['server_adress']);
$daemon = new Daemon($logger, $config['production']);
$daemon->addTask(new DummyTask());
$daemon->addTask(new RedisTask($redis));
$daemon->run(new RedisServer($redis, new SplObjectStorage()));