Laravel queues and push

I am using the library: https://github.com/davibennun/laravel-push-notification

I am trying to convert this (100% working) example:

Queue::push(function() {
    $push = PushNotification::app('SomeApp')
                    ->to('some_recipient')
                    ->send('Hello World, im a push message');
});

      

Something like that:

$push = PushNotification::app('SomeApp')
                ->to('some_recipient')
                ->queue('Hello World, im a push message'); // notice ->send is switched out to ->queue (like the Mail::queue method)

      

I've tried this:

In App.php

(facade for PushNotification

) - see https://github.com/davibennun/laravel-push-notification/tree/master/src/Davibennun/LaravelPushNotification .

public function queue($message, $options = array()) {

    Queue::push(function($job) use($message, $options) {
        $this->send($message, $options);

        $job->delete();
    });

    return $this;
}

      

Now my method doesn't work if my queue provider Iron

is - it does, however, work fine if my queue is sync

n't efficient.

The first example given works, but not as good as I want to accomplish the same thing.

+3
php queue laravel laravel-4 iron.io


source to share


No one has answered this question yet

Check out similar questions:

2
Laravel 5.3 issue queue notification
2
APNS with Laravel queues
1
Laravel queue not running as background
1
Laravel queue not working
1
Laravel booking notifications
1
Easiest way to use Mail :: queue with Laravel 5, IronMQ?
0
Iron.io: "The message must be no more than 64 KB"
0
Mail :: queue Closure serialization error Laravel 5.1
0
Laravel sample queue configuration
0
Laravel 4 + Iron Mq: queues started but mail not sent



All Articles
Loading...
X
Show
Funny
Dev
Pics