title: HOW TO: Get real-time notifications in Laravel 4 using Iron.io MQ, Push Queues & AJAX
body: <p>I've integrated <code>ironMQ</code> push queues in my Laravel 4 app for longer running processes. I have some views that perform a <code>$.get</code> that might take 30 seconds. I wanted to see what others are doing to easily get notified when <code>ironMQ</code> is done pushing back to an endpoint.</p>
  
  <p>An example of what I will be doing with push queues mostly:</p>
  
  <pre><code>public function getCompletedTasks() {
  
      $user = User::find(Auth::user()-&gt;id);
  
      Queue::push(function($job) use ($user) {
          $recent = new Recent;
          $tasks  = $recent-&gt;getCompletedTasks($user);
          // append data from $tasks to DOM
          // here's where I want to receive my notification
      });     
  }
  </code></pre>
  
  <p>Here I am just getting tasks from an API that match data from user.</p>
  
  <p>I know I can store the response data to a database and use AJAX long polling to constantly check for the data but it seems like too much work for most situations I will need to do this. I don't know much about websockets. What types of things have you guys done in these situations? And if you have any examples that would be very helpful. Thanks.</p>
  
  <p><strong>UPDATE</strong>: Solved the issue using Pusher. See my answer.</p>