Class TestSubscriptionConsumer
Test Subscription Consumer
Minimal subscription consumer implementation for testing.
Namespace: Cake\Queue\TestSuite\Transport
Method Summary
-
consume() public
Consume
-
subscribe() public
Subscribe
-
unsubscribe() public
Unsubscribe
-
unsubscribeAll() public
Unsubscribe all
Method Detail
consume() ¶ public
consume(int $timeout = 0): void
Consume
Parameters
-
int$timeout optional Timeout in milliseconds
Returns
voidsubscribe() ¶ public
subscribe(Consumer $consumer, callable $callback): void
Subscribe
A callback function to which the consumed message will be passed. The function must accept at a minimum one parameter, an \Interop\Queue\Message object, and an optional second parameter the \Interop\Queue\Consumer from which the message was consumed. The consumer will not return the processing thread back to the PHP script until the callback function returns FALSE.
Parameters
-
Consumer$consumer Consumer
-
callable$callback Callback
Returns
voidunsubscribe() ¶ public
unsubscribe(Consumer $consumer): void
Unsubscribe
Parameters
-
Consumer$consumer Consumer
Returns
void