title: Message Queue in PHP
body: <p>I have developed a rest api which accepts some data and store it in a message queue (Redis List). Now from redis this data is pushed into MySQL database.
  The problem is client needs to wait till the data is written into mysql.</p>
  
  <p>I want that the client should wait till the data is written into message queue (Redis List) and the function to push the data into MySQL should execute Asynchronously.
  How can I do it ? My entire code base is in PHP, So I would prefer it in PHP.</p>
  
  <p>I have read this but havn't tried.</p>
  
  <p><a href="http://redis4you.com/code.php?id=012" rel="noreferrer">Distributed queue example in PHP using Redis</a>   </p>
  
  <p>I have confusion that how slave.php ( mentioned in the link) will be executed. I mean When a new message arrives in the queue, how slave.php will find this.</p>
  
  <p>I dont want to use cronjob for this. Instead when a new message arrives slave.php should get executed asynchronously. How to do it?</p>