-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask.php
More file actions
35 lines (22 loc) · 676 Bytes
/
task.php
File metadata and controls
35 lines (22 loc) · 676 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
26
27
28
29
30
31
32
33
34
<?php
/**
* Created by PhpStorm.
* User: meShell
* Date: 2018/4/21
* Time: 22:03
*/
require __DIR__ . '/../../vendor/autoload.php';
$config = require __DIR__ . '/../config.php';
$config['setting']['dispatch_mode'] = 2;
$config['setting']['task_worker_num'] = 10;
$config['server'] = 'tcp';
$config['protocol'] = \Surf\Server\Tcp\Protocol\JsonProtocol::class;
$app = new \Surf\Application(__DIR__, [
'app.config' => $config
]);
$app->register(new \Surf\Provider\RedisServiceProvider());
$app->addProtocol('user.task', \Surf\Examples\TestTcpController::class . ':taskTest');
try {
$app->run();
} catch (\Surf\Exception\ServerNotFoundException $e) {
}