src/Graviton/RabbitMqBundle/Listener/EventStatusLinkResponseListener.php
private function getSubscribedWorkerIds(QueueEvent $queueEvent)
    {
        // compose our regex to match stars ;-)
        // results in = /((\*|document)+)\.((\*|dude)+)\.((\*|config)+)\.((\*|update)+)/
        $routingArgs = explode('.', $queueEvent->getEvent());
        $regex =
            '/'.
            implode(
                '\.',
                array_map(
                    function ($arg) {
                        return '((\*|'.$arg.')+)';
                    },
                    $routingArgs
                )
            ).
            '/';

        // look up workers by class name
        $qb = $this->documentManager->createQueryBuilder($this->eventWorkerClassname);
        $data = $qb
            ->select('id')
            ->field('subscription.event')
            ->equals(new \MongoRegex($regex))
            ->getQuery()
            ->execute()
            ->toArray();

        return array_keys($data);
    }
private function getSubscribedWorkerIds(QueueEvent $queueEvent)
    {
        // compose our regex to match stars ;-)
        // results in = /((\*|document)+)\.((\*|dude)+)\.((\*|config)+)\.((\*|update)+)/
        $routingArgs = explode('.', $queueEvent->getEvent());
        $regex =
            '/'.
            implode(
                '\.',
                array_map(
                    function ($arg) {
                        return '((\*|'.$arg.')+)';
                    },
                    $routingArgs
                )
            ).
            '/';

        // look up workers by class name
        $qb = $this->documentManager->createQueryBuilder($this->eventWorkerClassname);
        $data = $qb
            ->select('id')
            ->field('subscription.event')
            ->equals(new \MongoRegex($regex))
            ->getQuery()
            ->execute()
            ->toArray();

        return array_keys($data);
    }
private function getSubscribedWorkerIds ( QueueEvent $ queueEvent ) { // compose our regex to match stars ;-) // results in = /((\*|document)+)\.((\*|dude)+)\.((\*|config)+)\.((\*|update)+)/ $ routingArgs = explode ( '.' , $ queueEvent -> getEvent ( ) ) ; $ regex = '/' . implode ( '\.' , array_map ( function ( $ arg ) { return '((\*|' . $ arg . ')+)' ; } , $ routingArgs ) ) . '/' ; // look up workers by class name $ qb = $ this -> documentManager -> createQueryBuilder ( $ this -> eventWorkerClassname ) ; $ data = $ qb -> select ( 'id' ) -> field ( 'subscription.event' ) -> equals ( new \ MongoRegex ( $ regex ) ) -> getQuery ( ) -> execute ( ) -> toArray ( ) ; return array_keys ( $ data ) ; }
Checks EventWorker for worker that are subscribed to our event and returns
their workerIds as array

@param QueueEvent $queueEvent queueEvent object

@return array array of worker ids
Checks EventWorker for worker that are subscribed to our event and returns their workerIds as array