<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sun, 12 Feb 2012 19:49:56 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPMaster.com: Zend Job Queue]]></title>
      <guid>http://www.phpdeveloper.org/news/17388</guid>
      <link>http://www.phpdeveloper.org/news/17388</link>
      <description><![CDATA[<p>
In <a href="http://phpmaster.com/zend-queue/">this most recent post</a> to PHPMaster.com <i>Alex Stetsenko</i> takes a look at the Zend Job Queue functionality, a part of the <a href="http://www.zend.com/products/server/">Zend Server</a> installation. He talks about some basic usage to make HTTP requests and a more extended example showing report generation.
</p>
<blockquote>
Web applications usually follow a synchronous communication model. However, non-interactive and long-running tasks (such as report generation) are better suited for asynchronous execution. One way to off-load tasks to run at a later time, or even on a different server, is use the Job Queue module available as a part of Zend Server 5 (though not as part of the Community Edition). Job Queue allows job scheduling based on time, priority, and even dependencies
</blockquote>
<p>
In his two examples, he shows the code involved to create a new Queue object and define a HttpJob in it. The first just calls a "sample.php" script that's exposed as a part of your external-facing site and shows how you can get the current status of the job. The more advanced example shows a call to a "report.php" script with a set of options defining things like "type", "length" and "priority". He also points out some other options that can do similar things like <a href="http://gearman.org/">Gearman</a>, <a href="http://nodejs.org/">NodeJs</a> and <a href="http://www.rabbitmq.com/">RabbitMQ</a>.
</p>]]></description>
      <pubDate>Fri, 13 Jan 2012 08:37:31 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Justin Carmony's Blog: PHP Workers with Redis & Solo]]></title>
      <guid>http://www.phpdeveloper.org/news/17378</guid>
      <link>http://www.phpdeveloper.org/news/17378</link>
      <description><![CDATA[<p>
In <a href="http://www.justincarmony.com/blog/2012/01/10/php-workers-with-redis-solo/">this latest post</a> to his blog <i>Justin Carmony</i> shares some of his experience using Redis and <a href="http://timkay.com/solo/solo">Solo</a> to asynchronously run queries and return data without the user having to wait. 
</p>
<blockquote>
Sometimes there are situations when you want to parallel process things. Other times you might have a list of tasks to accomplish, and you don't want to make the user wait after pressing a button. This is where "Workers" can come in. They are independent scripts that run along side of your application, performing tasks, or "jobs."
</blockquote>
<p>
Solo is a very basic Perl script that ensures only one process of a type is running at once. Using this and a PHP library called <a href="https://github.com/nrk/predis">predis</a>, he shows how to set up workers and add items to your processing queue. The workers themselves run on a cron job and connect to the queue server to see what they need to do. He also throws in some "bells and whistles" - extras that can enhance your worker system: queue monitoring, version numbering and killing workers based on a hash value.
</p>
<p>
His code examples are posted on <a href="https://github.com/JustinCarmony/PHP-Workers-with-Redis-Solo-Examples">his github account</a> and a screencast is <a href="http://www.justincarmony.com/blog/2012/01/10/php-workers-with-redis-solo/">included in the post</a> to show the system in action.
</p>]]></description>
      <pubDate>Wed, 11 Jan 2012 11:50:52 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Understanding the Command Design Pattern]]></title>
      <guid>http://www.phpdeveloper.org/news/17335</guid>
      <link>http://www.phpdeveloper.org/news/17335</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new article introducing you to the Command design pattern and looking to help you <a href="http://phpmaster.com/understanding-the-command-design-pattern">understand its use a bit better</a>.
</p>
<blockquote>
The majority of [cell phone] users have opted to receive an email, but a significant number are now opting to receive the notifications via SMS. Here's the problem: How do you send a message via two different channels to both groups of users? The logical approach would be to split the users into 2 groups, email recipients and SMS recipients, which would involve running 2 different queries and sending the codeword to each group separately. Using the Command Pattern, which I will introduce you to in this article, you can send the message to both groups of users in a single process.
</blockquote>
<p>
He uses the message queue he mentioned as an example - showing how you can can queue up different kinds of objects (actions) based on a common interface into the same process. He creates a "DailyAlertEmail" and "DailyAlertSMS" classes, both with a "send" method. The settings for these are then pulled from a database and the "execute" method on the "MessageQueue" class is called to loop through them, calling "send" to do that work.
</p>]]></description>
      <pubDate>Tue, 03 Jan 2012 08:25:29 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Rasmus Lerdorf's Blog: ZeroMQ + libevent in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16928</guid>
      <link>http://www.phpdeveloper.org/news/16928</link>
      <description><![CDATA[<p>
<i>Rasmus Lerdorf</i> has a new post to his blog sharing the results of some "investigative hacking" he did to see if making <a href="http://toys.lerdorf.com/archives/57-ZeroMQ-+-libevent-in-PHP.html">ZeroMQ and libevent</a> work together was difficult. Thankfully, the answer was "not hard at all".
</p>
<blockquote>
While waiting for a connection in Frankfurt I had a quick look at what it would take to make ZeroMQ and libevent co-exist in PHP and it was actually quite easy. Well, easy after Mikko Koppanen added a way to get the underlying socket fd from the ZeroMQ PHP extension. To get this working, install the <a href="http://www.zeromq.org/bindings:php">PHP ZeroMQ extension</a> and the <a href="http://pecl.php.net/package/libevent">PHP libevent extension</a>.
</blockquote>
<p>
He includes a sample script show the results of his work, a basic server and client that sends a request to the ZeroMQ server and fires off an event using the <a href="http://libevent.org/">libevent</a> library (via PHP's <a href="http://pecl.php.net/package/libevent">extension</a>. You can find out more about using these two libraries in the PHP manual - <a href="http://php.net/libevent">libevent</a> and <a href="http://php.zero.mq/">ZeroMQ</a>
</p>]]></description>
      <pubDate>Thu, 29 Sep 2011 11:45:39 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Kevin Schroeder's Blog: Passing typed ActionScript objects to Flex using PHP and a message queue]]></title>
      <guid>http://www.phpdeveloper.org/news/16433</guid>
      <link>http://www.phpdeveloper.org/news/16433</link>
      <description><![CDATA[<p>
Continuing on in his Flex and PHP series <i>Kevin Schroeder</i> has a new post to his blog today looking at how to <a href="http://www.eschrade.com/page/passing-typed-actionscript-objects-to-flex-using-php-and-a-message-queue/">send typed ActionScript objects</a> to Flex so he could pass PHP objects and their structure directly back to the waiting frontend.
</p>
<blockquote>
What I wanted to do was use the sales notification mechanism to pass PHP objects to Flex using the message queue.  But I could not get the unserialization mechanism to work and so I had to settle for passing a simple message that a sale had been made. However, because you can pass typed objects back and forth between PHP and ActionScript over HTTP using Zend_Amf_Server I figured that there MUST be a way of doing it automatically.
</blockquote>
<p>
He walks you through the steps to discovery that eventually got him to his end goal - making a simple valueObject class to use for the connection, a basic PHP script (using Zend_Amf) to parse the object's data and a bit of code to send it back to the waiting MQ queue via a Zend_Queue adapter.
</p>]]></description>
      <pubDate>Tue, 07 Jun 2011 08:20:12 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Kevin Schroeder's Blog: Added (PHP 5.3) job queuing to my WordPress instance]]></title>
      <guid>http://www.phpdeveloper.org/news/16073</guid>
      <link>http://www.phpdeveloper.org/news/16073</link>
      <description><![CDATA[<p>
<i>Kevin Schroeder</i> has a quick post to his blog talking about the <a href="http://www.eschrade.com/page/added-php-5-3-job-queuing-to-my-wordpress-instance/">integration of job queuing</a> he's done with his WordPress blog to build a list of popular posts for his sidebar.
</p>
<blockquote>
One of the things I liked on my old blog was the ability to have a <a href="http://www.eschrade.com/page/google-analytics-feed-handling-4c251fea/">Popular Posts section that was based off of Google Analytics</a>. [...] So I had missed that, but it was not overly important so I left it.  But yesterday was a day where I needed something that was both engaging and brainless to do.  So I decided to implement my <a href="https://github.com/kschroeder/ZendServer-JobQueue-Job-API">Job Queue API</a> code for WordPress so that I could write a WordPress widget that would put the popular posts in the sidebar.
</blockquote>
<p>
He's <a href="http://www.eschrade.com/media/eschrade.tgz">created a plugin</a> to handle most of the heavy lifting for you. 
</p>]]></description>
      <pubDate>Mon, 21 Mar 2011 10:09:05 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weier O'Phinney's Blog: Taming SplPriorityQueue]]></title>
      <guid>http://www.phpdeveloper.org/news/15760</guid>
      <link>http://www.phpdeveloper.org/news/15760</link>
      <description><![CDATA[<p>
<i>Matthew Weier O'Phinney</i> has <a href="http://weierophinney.net/matthew/archives/253-Taming-SplPriorityQueue.html">a new post</a> to his blog today looking at one of the tools the <a href="http://php.net/spl">Standard PHP Library (SPL)</a> has to offer developers - the SplPriorityQueue (PHP 5.3+)
</p>
<blockquote>
<a href="http://php.net/SplPriorityQueue">SplPriorityQueue</a> is a fantastic new feature of PHP 5.3. However, in trying to utilize it in a few projects recently, I've run into some behavior that's (a) non-intuitive, and (b) in some cases at least, undesired. In this post, I'll present my solutions.
</blockquote>
<p>
He talks about the "first in, first out" nature of queues and how it differs from a stack (including links to some of the other SPL offerings for both). He then moves into the problems he was seeing - that iteration removes values from the heap and the unexpected order of equal values in the queue. To solve the first problem, he creates an "outer iterator" that creates an "innerQueue" that's protected. The solution for the second issue - the random queue order - is a simple one: priority indexes aren't required to be integers. Strings can be substituted to help make things a bit more unique.
</p>]]></description>
      <pubDate>Tue, 18 Jan 2011 12:43:54 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Enrise.com: Using MemcacheQ as Message Queue]]></title>
      <guid>http://www.phpdeveloper.org/news/15734</guid>
      <link>http://www.phpdeveloper.org/news/15734</link>
      <description><![CDATA[<p>
<i>Tim de Pater</i> has <a href="http://www.enrise.com/2011/01/using-memcacheq-as-message-queue/">a new post</a> to the Enrise blog showing how you can use the <a href="http://memcachedb.org/memcacheq/">MemcacheQ</a> tool to act as a message queue for an application.
</p>
<blockquote>
Using a <a href="http://en.wikipedia.org/wiki/Message_queue">message queue</a> can help to suspend heavy processes and execute them later so you won't bother your visitors with long waiting times. There are a few solutions for queuing like <a href="http://gearman.org/">Gearman</a>, <a href="http://activemq.apache.org/">ActiveMQ</a> and <a href="http://www.zend.com/en/products/server/zend-server-job-queue">Zend Server Job Queue</a>. For www.nd.nl (a Dutch newspaper) we wanted a simple and free queue mechanism that integrates with <a href="http://framework.zend.com/">Zend Framework</a> for handling a number of jobs. We found <a href="http://memcachedb.org/memcacheq/">MemcacheQ</a>.
</blockquote>
<p>
He talks a bit about what MemcacheQ is ("damn simple, very fast, great concurrency") and about the fact you can use existing memcache technology to interact with it. He points out the <a href="http://framework.zend.com/manual/en/zend.queue.adapters.html">Zend_Queue_Adapter_Memcacheq</a> component of the Zend Framework and shows an example of how to use it in a simple app to store a simple process. There's also a script that would run in a cron job (or something similar) and pull out these processes and execute them.
</p>]]></description>
      <pubDate>Thu, 13 Jan 2011 10:59:03 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Kevin Schroeder's Blog: Could your PHP application benefit from asynchronous computing?]]></title>
      <guid>http://www.phpdeveloper.org/news/15228</guid>
      <link>http://www.phpdeveloper.org/news/15228</link>
      <description><![CDATA[<p>
<i>Kevin Schroeder</i> has been conducting an informal poll about asynchronous computing in PHP applications and has <a href="http://www.eschrade.com/page/could-your-application-benefit-from-asynchronous-computing-4ca9de5a">posted some of the results</a> (as well as the poll for those that didn't get their votes in) to his blog today.
</p>
<blockquote>
Tis the season for Zendcon.  I am going to be giving a talk at Zendcon called "Do You Queue".  It will be about doing asynchronous computing in PHP.  In order for me to gather some data I posted a twitpoll poll.  The response has been pretty good.  However, there have also been several misunderstandings as well. 
</blockquote>
<p>
He points out a few comments on the poll that talk about asynchronous processing being included in the language and dismiss it as something that other technology already does. He agrees that threads shouldn't be in PHP because it would break on of PHP's strongest features - the Shared Nothing architecture. Want to share your opinion? <a href="http://www.eschrade.com/page/could-your-application-benefit-from-asynchronous-computing-4ca9de5a">Vote on the poll</a> and be heard!
</p>]]></description>
      <pubDate>Tue, 05 Oct 2010 08:42:16 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Kevin Schroeder's Blog: How to (properly) evaluate Zend Server - Introduction]]></title>
      <guid>http://www.phpdeveloper.org/news/15058</guid>
      <link>http://www.phpdeveloper.org/news/15058</link>
      <description><![CDATA[<p>
<i>Kevin Schroeder</i> has <a href="http://www.eschrade.com/page/properly-evaluate-zend-server-part-4c7d75fb">a new post to his blog</a> today on how to correctly evaluate the <a href="http://www.zend.com/en/products/server/">Zend Server</a> product from <a href="http://zend.com">Zend</a> (disclaimer: he is a Zend employee).
</p>
<blockquote>
As you all probably know, Zend has salespeople.  Those sales people have sales engineers who show how to use our products.  However, I personally hate being on the phone for a canned presentation when all I really want to do is tinker.  So, in an effort to produce something of benefit today I decided to start a series of blog posts on how to evaluate Zend Server if you are a tinkerer, like me.
</blockquote>
<p>
He gives a list of some of the features that the product comes with, but will only really focus on three of them in his series - application monitoring, code tracing and the Zend Server job queue (because he thinks they're the best of the crop). This post is just an introduction to the product and an overview of what it offers - expect more detail to come in future posts.
</p>]]></description>
      <pubDate>Wed, 01 Sep 2010 10:36:37 -0500</pubDate>
    </item>
  </channel>
</rss>

