Class TestDriver
Test Driver
Minimal driver implementation that uses GenericDriver internally.
Namespace: Cake\Queue\TestSuite\Transport
Method Summary
-
__construct() public
Constructor
-
createClientMessage() public
-
createQueue() public
-
createRouteQueue() public
-
createRouterTopic() protected
-
createTransportMessage() public
-
createTransportQueueName() protected
-
createTransportRouterTopicName() protected
-
doCreateQueue() protected
-
doCreateTopic() protected
-
doSendToProcessor() protected
-
doSendToRouter() protected
-
getConfig() public
-
getContext() public
-
getPriorityMap() protected
[client message priority => transport message priority].
-
getRouteCollection() public
-
sendToProcessor() public
-
sendToRouter() public
-
setupBroker() public
Prepare broker for work. Creates all required queues, exchanges, topics, bindings etc.
Method Detail
__construct() ¶ public
__construct(Context $context, Config $config, Enqueue\Client\RouteCollection $routes)
Constructor
Parameters
-
Context$context Context
-
Config$config Client config
-
Enqueue\Client\RouteCollection$routes Route collection
createClientMessage() ¶ public
createClientMessage(InteropMessage $message): Message
Parameters
-
InteropMessage$message
Returns
MessagecreateQueue() ¶ public
createQueue(string $queueName, bool $prefix = true): InteropQueue
Parameters
-
string$queueName -
bool$prefix optional
Returns
InteropQueuecreateRouteQueue() ¶ public
createRouteQueue(Route $route): InteropQueue
Parameters
-
Route$route
Returns
InteropQueuecreateTransportMessage() ¶ public
createTransportMessage(Message $message): InteropMessage
Parameters
-
Message$message
Returns
InteropMessagecreateTransportQueueName() ¶ protected
createTransportQueueName(string $name, bool $prefix): string
Parameters
-
string$name -
bool$prefix
Returns
stringcreateTransportRouterTopicName() ¶ protected
createTransportRouterTopicName(string $name, bool $prefix): string
Parameters
-
string$name -
bool$prefix
Returns
stringdoCreateQueue() ¶ protected
doCreateQueue(string $transportQueueName): InteropQueue
Parameters
-
string$transportQueueName
Returns
InteropQueuedoCreateTopic() ¶ protected
doCreateTopic(string $transportTopicName): InteropTopic
Parameters
-
string$transportTopicName
Returns
InteropTopicdoSendToProcessor() ¶ protected
doSendToProcessor(InteropProducer $producer, InteropQueue $queue, InteropMessage $transportMessage): void
Parameters
-
InteropProducer$producer -
InteropQueue$queue -
InteropMessage$transportMessage
Returns
voiddoSendToRouter() ¶ protected
doSendToRouter(InteropProducer $producer, Destination $topic, InteropMessage $transportMessage): void
Parameters
-
InteropProducer$producer -
Destination$topic -
InteropMessage$transportMessage
Returns
voidgetPriorityMap() ¶ protected
getPriorityMap(): int[]
[client message priority => transport message priority].
Returns
int[]sendToProcessor() ¶ public
sendToProcessor(Message $message): DriverSendResult
Parameters
-
Message$message
Returns
DriverSendResultsendToRouter() ¶ public
sendToRouter(Message $message): DriverSendResult
Parameters
-
Message$message
Returns
DriverSendResultsetupBroker() ¶ public
setupBroker(?LoggerInterface $logger = null): void
Prepare broker for work. Creates all required queues, exchanges, topics, bindings etc.
Parameters
-
?LoggerInterface$logger optional
Returns
void