Skip to content

Commit 7b47012

Browse files
authored
Merge pull request #55 from dotkernel/release-preps
Prepare for release
2 parents 9428e32 + 3efeb95 commit 7b47012

33 files changed

+260
-175
lines changed

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
> [!IMPORTANT]
44
> Dotkernel component used to queue tasks to be processed asynchronously based on [netglue/laminas-messenger](https://github.com/netglue/laminas-messenger)
55
6-
A queue system is a vital component in modern web applications that enables the decoupling of certain tasks from the regular request-response cycle.
6+
A queue system is a vital part in modern web applications that enables the decoupling of certain tasks from the regular request-response cycle.
77

8-
This is especially useful for time-consuming and resource-intensive operations which are thus handled asynchronously by background workers on a separate system.
8+
This is especially useful for time-consuming and resource-intensive operations which are thus handled asynchronously by background workers on a separate system.
99

10-
The greatest benefit is to application responsiveness which allows faster execution, while the heavy lifting is scheduled in the queue based on available resources.
10+
The greatest benefit is to application responsiveness, which allows faster execution, while the heavy lifting is scheduled in the queue based on available resources.
1111

12-
The queue system uses logs to ensure maintainability and implements retry features for reliability and stability.
12+
The queue system uses logs to ensure maintainability and implements retry features for reliability and stability.
1313

1414
![Queue process](https://docs.dotkernel.org/img/queue/schema.png)
1515

@@ -28,10 +28,6 @@ The greatest benefit is to application responsiveness which allows faster execut
2828
[![Qodana](https://github.com/dotkernel/queue/actions/workflows/qodana_code_quality.yml/badge.svg?branch=main)](https://github.com/dotkernel/queue/actions/workflows/qodana_code_quality.yml)
2929
[![PHPStan](https://github.com/dotkernel/queue/actions/workflows/static-analysis.yml/badge.svg?branch=main)](https://github.com/dotkernel/queue/actions/workflows/static-analysis.yml)
3030

31-
## Installation
32-
33-
> Until we have a compiled documentation, read the files from /doc/book/v1 folder
34-
3531
## Documentation
3632

3733
Documentation is available at: https://docs.dotkernel.org/queue-documentation

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@
5555
},
5656
"require-dev": {
5757
"laminas/laminas-coding-standard": "^3.0",
58-
"phpunit/phpunit": "^10.5.45",
59-
"roave/security-advisories": "dev-master",
60-
"swoole/ide-helper": "~5.0.0",
6158
"phpstan/phpstan": "^2.0",
6259
"phpstan/phpstan-doctrine": "^2.0",
63-
"phpstan/phpstan-phpunit": "^2.0"
60+
"phpstan/phpstan-phpunit": "^2.0",
61+
"phpunit/phpunit": "^10.5.45",
62+
"roave/security-advisories": "dev-master",
63+
"swoole/ide-helper": "~5.0.0"
6464
},
6565
"autoload": {
6666
"psr-4": {

config/autoload/local.php.dist

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
declare(strict_types=1);
1111

12-
$baseUrl = 'http://queue.dotkernel.net';
12+
$baseUrl = 'https://queue.dotkernel.net';
1313

1414
$databases = [
1515
'default' => [
@@ -43,13 +43,13 @@ return [
4343
'protocol' => 'tcp',
4444
'host' => 'localhost',
4545
'port' => '8556',
46-
'eof' => "\n",
46+
'eof' => PHP_EOL,
4747
],
4848
],
4949
//delay time until the message is added back to the queue if an error occurs during processing
5050
'fail-safe' => [
51-
'first_retry' => 3600000, // 1h
52-
'second_retry' => 43200000, // 12h
53-
'third_retry' => 86400000, // 24h
54-
],
51+
'first_retry' => 3600000, // 1h
52+
'second_retry' => 43200000, // 12h
53+
'third_retry' => 86400000, // 24h
54+
],
5555
];

config/autoload/log.local.php.dist

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Dot\Log\Formatter\Json;
46
use Dot\Log\Logger;
57

@@ -9,17 +11,17 @@ return [
911
'queue-log' => [
1012
'writers' => [
1113
'FileWriter' => [
12-
'name' => 'stream',
13-
'level' => \Dot\Log\Logger::ALERT, // this is equal to 1
14+
'name' => 'stream',
15+
'level' => Logger::ALERT,
1416
'options' => [
15-
'stream' => __DIR__ . '/../../log/queue-log.log',
17+
'stream' => __DIR__ . '/../../log/queue-log.log',
1618
'formatter' => [
1719
'name' => Json::class,
1820
],
1921
],
2022
],
2123
],
22-
]
24+
],
2325
],
2426
],
2527
];
Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Netglue\PsrContainer\Messenger\Container\TransportFactory;
6+
use Psr\Container\ContainerInterface;
47
use Symfony\Component\Messenger\Transport\Serialization\PhpSerializer;
58
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface as SymfonySerializer;
69

710
return [
8-
"symfony" => [
9-
"messenger" => [
10-
"transports" => [
11-
"redis_transport" => [
12-
'dsn' => 'redis://127.0.0.1:6379/messages',
13-
'options' => [], // Redis specific options
11+
'symfony' => [
12+
'messenger' => [
13+
'transports' => [
14+
'redis_transport' => [
15+
'dsn' => 'redis://127.0.0.1:6379/messages',
16+
'options' => [], // Redis specific options
1417
'serializer' => SymfonySerializer::class,
15-
]
16-
]
17-
]
18+
],
19+
],
20+
],
21+
],
22+
'dependencies' => [
23+
'factories' => [
24+
'redis_transport' => [TransportFactory::class, 'redis_transport'],
25+
SymfonySerializer::class => fn(ContainerInterface $container) => new PhpSerializer(),
26+
],
1827
],
19-
"dependencies" => [
20-
"factories" => [
21-
"redis_transport" => [TransportFactory::class, 'redis_transport'],
22-
SymfonySerializer::class => fn(\Psr\Container\ContainerInterface $container) => new PhpSerializer()
23-
]
24-
]
25-
];
28+
];

config/autoload/swoole.local.php.dist

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
return [
46
'dotkernel-queue-swoole' => [
5-
// Available in Swoole 4.1 and up; enables coroutine support
6-
// for most I/O operations:
7+
// Available in Swoole 4.1 and up; enables coroutine support for most I/O operations:
78
'enable_coroutine' => true,
89

910
// Configure Swoole TCP Server:
@@ -13,17 +14,17 @@ return [
1314
'mode' => SWOOLE_BASE, // SWOOLE_BASE or SWOOLE_PROCESS;
1415
// SWOOLE_BASE is the default
1516
'protocol' => SWOOLE_SOCK_TCP, // SWOOLE_SSL, // SSL-enable the server
16-
'options' => [
17+
'options' => [
1718
// Set the SSL certificate and key paths for SSL support:
1819
//'ssl_cert_file' => 'path/to/ssl.crt',
1920
//'ssl_key_file' => 'path/to/ssl.key',
20-
// Whether or not the HTTP server should use coroutines;
21+
// Whether the HTTP server should use coroutines;
2122
// enabled by default, and generally should not be disabled:
22-
'package_eof' => "\n",
23-
'open_eof_check' => true,
23+
'package_eof' => PHP_EOL,
24+
'open_eof_check' => true,
2425
'open_length_check' => true,
2526

26-
// in order to run swoole as daemon
27+
// to run swoole as a daemon
2728
'daemonize' => true,
2829

2930
// Overwrite the default location of the pid file;

daemon/messenger.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ WorkingDirectory=/home/dotkernel/queue/
1212
ExecStart=/usr/bin/php /home/dotkernel/queue/bin/cli.php messenger:start
1313

1414
[Install]
15-
WantedBy=swoole.service
15+
WantedBy=swoole.service

daemon/swoole.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ WorkingDirectory=/home/dotkernel/queue/
1212
ExecStart=/usr/bin/php /home/dotkernel/queue/bin/cli.php swoole:start
1313

1414
[Install]
15-
WantedBy=multi-user.target
15+
WantedBy=multi-user.target

phpcs.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313

1414
<!-- Paths to check -->
1515
<file>config</file>
16+
<file>public</file>
1617
<file>src</file>
1718
<file>test</file>
1819
<exclude-pattern>config/config.php</exclude-pattern>
19-
<exclude-pattern>config/routes.php</exclude-pattern>
2020

2121
<!-- Include all rules from the Laminas Coding Standard -->
2222
<rule ref="LaminasCodingStandard">

phpstan.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ includes:
44
parameters:
55
level: 5
66
paths:
7+
- config
8+
- public
79
- src
810
- test
911
treatPhpDocTypesAsCertain: false

0 commit comments

Comments
 (0)