mirror of
https://github.com/win32service/Win32ServiceBundle.git
synced 2026-04-27 02:38:02 +02:00
Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 26ab698a72 | |||
| 764337d0a8 | |||
| fbfedf4205 | |||
| 896da203d1 | |||
| 29480592cb | |||
| 26dbef58d3 | |||
| b78326a847 | |||
| 5b279891af | |||
| 0c0a7cc756 | |||
| 2cd6704473 | |||
| 62e6137287 | |||
| 55fd2033ad | |||
| 08c0b73107 | |||
| ff661eea1b | |||
| bcee3e0562 | |||
| 2025d94208 | |||
| 8a9f74a606 | |||
| 68b542430f | |||
| 6644c3410b | |||
| d08e424b1b | |||
| 3091b0beea | |||
| b3bf4ff439 | |||
| 81052cea72 |
@@ -113,9 +113,9 @@ class Configuration implements ConfigurationInterface
|
||||
->integerNode('thread_count')->defaultValue(1)->min(1)->end()
|
||||
->booleanNode('delayed_start')->defaultFalse()->end()
|
||||
->integerNode('limit')->defaultValue(0)->min(0)->end()
|
||||
->integerNode('failure-limit')->defaultValue(0)->min(0)->end()
|
||||
->integerNode('time-limit')->defaultValue(0)->min(0)->end()
|
||||
->scalarNode('memory-limit')->defaultValue('')->end()
|
||||
->integerNode('failure_limit')->defaultValue(0)->min(0)->end()
|
||||
->integerNode('time_limit')->defaultValue(0)->min(0)->end()
|
||||
->scalarNode('memory_limit')->defaultValue('')->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
|
||||
@@ -52,7 +52,7 @@ final class MessengerServiceRunner extends AbstractServiceRunner
|
||||
private ?LoggerInterface $logger = null,
|
||||
private array $receiverNames = [],
|
||||
private ?ResetServicesListener $resetServicesListener = null,
|
||||
private array $busIds = []
|
||||
private array $busIds = [],
|
||||
) {
|
||||
$this->unacks = new \SplObjectStorage();
|
||||
}
|
||||
@@ -66,15 +66,15 @@ final class MessengerServiceRunner extends AbstractServiceRunner
|
||||
if ($limit > 0) {
|
||||
$this->eventDispatcher->addSubscriber(new StopWorkerOnMessageLimitListener($limit, $this->logger));
|
||||
}
|
||||
$failureLimit = (int) $this->config['failure-limit'];
|
||||
$failureLimit = (int) $this->config['failure_limit'];
|
||||
if ($failureLimit > 0) {
|
||||
$this->eventDispatcher->addSubscriber(new StopWorkerOnFailureLimitListener($failureLimit, $this->logger));
|
||||
}
|
||||
$timeLimit = (int) $this->config['time-limit'];
|
||||
$timeLimit = (int) $this->config['time_limit'];
|
||||
if ($timeLimit > 0) {
|
||||
$this->eventDispatcher->addSubscriber(new StopWorkerOnTimeLimitListener($timeLimit, $this->logger));
|
||||
}
|
||||
$memoryLimit = (string) $this->config['memory-limit'];
|
||||
$memoryLimit = (string) $this->config['memory_limit'];
|
||||
if ($memoryLimit > 0) {
|
||||
$this->eventDispatcher->addSubscriber(new StopWorkerOnMemoryLimitListener(
|
||||
$this->convertToBytes($memoryLimit),
|
||||
@@ -85,9 +85,9 @@ final class MessengerServiceRunner extends AbstractServiceRunner
|
||||
$this->receivers = [];
|
||||
foreach ($this->config['receivers'] as $receiverName) {
|
||||
if (!$this->receiverLocator->has($receiverName)) {
|
||||
$message = sprintf('The receiver "%s" does not exist.', $receiverName);
|
||||
$message = \sprintf('The receiver "%s" does not exist.', $receiverName);
|
||||
if ($this->receiverNames) {
|
||||
$message .= sprintf(' Valid receivers are: %s.', implode(', ', $this->receiverNames));
|
||||
$message .= \sprintf(' Valid receivers are: %s.', implode(', ', $this->receiverNames));
|
||||
}
|
||||
|
||||
throw new RuntimeException($message);
|
||||
@@ -105,7 +105,6 @@ final class MessengerServiceRunner extends AbstractServiceRunner
|
||||
|
||||
$this->shouldStop = true;
|
||||
$this->requestStop();
|
||||
throw new \RuntimeException('Stop requested');
|
||||
}
|
||||
|
||||
protected function beforeContinue(): void
|
||||
|
||||
@@ -6,4 +6,5 @@ win32_service:
|
||||
limit: 10
|
||||
displayed_name: Demo Messenger Consumer Async %d
|
||||
thread_count: 2
|
||||
memory_limit: 3600
|
||||
|
||||
|
||||
Reference in New Issue
Block a user