Laravel 4 Email Queue with Sync Driver

I just want to queue an email when a user logs in. So I do this when the user submits the registration form:

Mail::queue('emails.activate', $data, function($message) use ($user)
{
  $message->from('no-reply@mysite.com', 'Mysite.com');
  $message->to($user->email, $user->username)->subject('Welcome');
});

The queue listener is started (php artisan queue: listen queue) and the dispatcher process, make sure that it will restart if stopped.

This works, the user receives the email, but the HTTP response during registration is very slow, just as I would expect if I tried to send the email directly. If I comment on all of the above queue code, the HTTP response time is just fine.

I am using the sync driver in queue.app:

'default' => 'sync',
'connections' => array(

    'sync' => array(
        'driver' => 'sync',
    ),
    etc...

, (Ubuntu) postfix. - , , ?

+4
1

, Laravel . , .

+9

All Articles