PHP Class Uecode\Bundle\QPushBundle\Provider\IronMqProvider

Author: Keith Kirk ([email protected])
Inheritance: extends AbstractProvider
Datei anzeigen Open project: uecode/qpush-bundle Class Usage Examples

Public Methods

Method Description
__construct ( $name, array $options, $client, Doctrine\Common\Cache\Cache $cache, Logger $logger )
create ( ) {@inheritDoc}
delete ( $id ) {@inheritDoc}
destroy ( ) {@inheritDoc}
getProvider ( )
onMessageReceived ( Uecode\Bundle\QPushBundle\Event\MessageEvent $event ) : void Removes the message from queue after all other listeners have fired
onNotification ( Uecode\Bundle\QPushBundle\Event\NotificationEvent $event, string $eventName, Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher ) : void Polls the Queue on Notification from IronMQ
publish ( array $message, array $options = [] ) : integer {@inheritDoc}
publishMessages ( array $messages, array $options = [] ) : array Publishes multiple message at once
queueExists ( ) : boolean Checks whether or not the Queue exists
queueInfo ( ) : mixed Get queue info
receive ( array $options = [] ) {@inheritDoc}

Private Methods

Method Description
getReservationId ( $id ) : string | null

Method Details

__construct() public method

public __construct ( $name, array $options, $client, Doctrine\Common\Cache\Cache $cache, Logger $logger )
$options array
$cache Doctrine\Common\Cache\Cache
$logger Monolog\Logger

create() public method

{@inheritDoc}
public create ( )

delete() public method

{@inheritDoc}
public delete ( $id )

destroy() public method

{@inheritDoc}
public destroy ( )

getProvider() public method

public getProvider ( )

onMessageReceived() public method

If an earlier listener has failed or stopped propagation, this method will not fire and the Queued Message should become visible in queue again. Stops Event Propagation after removing the Message
public onMessageReceived ( Uecode\Bundle\QPushBundle\Event\MessageEvent $event ) : void
$event Uecode\Bundle\QPushBundle\Event\MessageEvent The SQS Message Event
return void

onNotification() public method

Dispatches the {queue}.message_received event
public onNotification ( Uecode\Bundle\QPushBundle\Event\NotificationEvent $event, string $eventName, Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher ) : void
$event Uecode\Bundle\QPushBundle\Event\NotificationEvent The Notification Event
$eventName string Name of the event
$dispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
return void

publish() public method

{@inheritDoc}
public publish ( array $message, array $options = [] ) : integer
$message array
$options array
return integer

publishMessages() public method

Publishes multiple message at once
public publishMessages ( array $messages, array $options = [] ) : array
$messages array
$options array
return array

queueExists() public method

This method relies on in-memory cache and the Cache provider to reduce the need to needlessly call the create method on an existing Queue.
public queueExists ( ) : boolean
return boolean

queueInfo() public method

This allows to get queue size. Allowing to know if processing is finished or not
public queueInfo ( ) : mixed
return mixed

receive() public method

{@inheritDoc}
public receive ( array $options = [] )
$options array