Skip to content

Commit 2f8cb97

Browse files
author
Vasiliev.A
committed
fix class and method descriptions
1 parent 270817f commit 2f8cb97

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

app/code/Magento/WebapiAsync/Plugin/Communication/Config/CompositeReader.php

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,36 @@
1111
use Magento\AsynchronousOperations\Model\ConfigInterface;
1212
use Magento\Framework\Communication\ConfigInterface as CommunicationConfig;
1313

14+
/**
15+
* Force change topic's defined as ServiceName:methodName from sync to async.
16+
* Topic type will be changed if topic name starts with
17+
* \Magento\AsynchronousOperations\Model\ConfigInterface::TOPIC_PREFIX
18+
*
19+
* @SuppressWarnings("unused")
20+
*/
1421
class CompositeReader
1522
{
1623
/**
17-
* Topics with type schema is always are sync
18-
* @see \Magento\Framework\Communication\Config\ReflectionGenerator::generateTopicConfigForServiceMethod().
19-
* This plugin add support for topic type schema defined as ServiceName:methodName
20-
* by force changing sync type to async
21-
* but only if topic name starts with ConfigInterface::TOPIC_PREFIX, e.g. async.*
24+
* Checking communication.xml merged configuration
25+
* to find topics with names started from "async"
26+
* \Magento\AsynchronousOperations\Model\ConfigInterface::TOPIC_PREFIX
27+
* and change config attribute value "is_synchronous" to false (make async)
28+
* for this topics.
2229
*
2330
* @param \Magento\Framework\Communication\Config\CompositeReader $subject
2431
* @param array $result
2532
*
2633
* @return array
27-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
2834
*/
29-
public function afterRead(\Magento\Framework\Communication\Config\CompositeReader $subject, array $result) {
35+
public function afterRead(\Magento\Framework\Communication\Config\CompositeReader $subject, array $result)
36+
{
3037
foreach ($result[CommunicationConfig::TOPICS] as $topicName => $topicConfig) {
3138
if (strpos($topicName, ConfigInterface::DEFAULT_HANDLER_NAME) === 0) {
3239
$topicConfig[CommunicationConfig::TOPIC_IS_SYNCHRONOUS] = false;
3340
$result[CommunicationConfig::TOPICS][$topicName] = $topicConfig;
3441
}
3542
}
43+
3644
return $result;
3745
}
3846
}

0 commit comments

Comments
 (0)