<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>NeverBlock Blog</title>
    <link>http://www.espace.com.eg/neverblock/neverblock/feed.rss/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>The RSS feed for NeverBlock blog.</description>
    
    
        <item>
          <title>NeverBlock Ready for the Big Time</title>
          <description>&lt;p&gt;eSpace has had NeverBlock enabled on its own Ruby applications for quite some time now and with a great degree of success. But NeverBlock has so much more to offer to the development community; eSpace is now providing a &lt;a href=&quot;http://www.espace.com.eg/services/neverblock&quot;&gt;service &lt;/a&gt;in which you can get NeverBlock enabled in your very own application.&lt;/p&gt;</description>
          <pubDate>Mon, 01 Jun 2009 12:13:32 GMT</pubDate>
          <guid>http://www.espace.com.eg/neverblock/blog/2009/06/01/neverblock-ready-for-the-big-time/</guid>
          <link>http://www.espace.com.eg/neverblock/blog/2009/06/01/neverblock-ready-for-the-big-time/</link>
        </item>
    
        <item>
          <title>eSpace's RubyConf Talk</title>
          <description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;A video of eSpace's Yasser Wahba's talk at the 2008 RubyConf is now online and you can watch it right here! Yasser's talk, which was entitled &lt;a href=&quot;http://www.rubyconf.org/talks/34&quot;&gt;&amp;ldquo;NeverBlock: Trivial Non-Blocking IO for Ruby&amp;rdquo;&lt;/a&gt;, covered how people can use NeverBlock to transparently gain IO parallelism in Ruby (and Rails) web applications.&lt;/p&gt;
&lt;p&gt;Enjoy the presentation!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
          <pubDate>Wed, 03 Dec 2008 09:43:44 GMT</pubDate>
          <guid>http://www.espace.com.eg/neverblock/blog/2008/12/03/espaces-rubyconf-talk/</guid>
          <link>http://www.espace.com.eg/neverblock/blog/2008/12/03/espaces-rubyconf-talk/</link>
        </item>
    
        <item>
          <title>NeverBlock Unleashed</title>
          <description>&lt;p&gt;&lt;span style=&quot;font-family: verdana,sans-serif;&quot;&gt;After months of development and meticulous hard work, NeverBlock is finally in production, having been deployed on eSpace's very own &lt;a href=&quot;http://meowns.com&quot;&gt;MeOwns.com&lt;/a&gt;. NeverBlock allows memory usage to decrease by 75%, while capacity for concurrent requests has been effectively doubled. This allows sites that utilize NeverBlock to increase their capacity for handling concurrent requests, while at the same time reducing memory requirements significantly. We also spent some time fixing the subtle MySQL connection issues that happened with long running requests. The result of the work is a more polished and solid NeverBlock that has been running smoothly on MeOwns.com for a while now, which increases our level of confidence in the &lt;/span&gt;&lt;span style=&quot;font-family: verdana,sans-serif;&quot;&gt;library and makes us believe that NeverBlock is now ready for prime time.&lt;/span&gt;&lt;/p&gt;</description>
          <pubDate>Thu, 27 Nov 2008 16:53:51 GMT</pubDate>
          <guid>http://www.espace.com.eg/neverblock/blog/2008/11/27/neverblock-unleashed/</guid>
          <link>http://www.espace.com.eg/neverblock/blog/2008/11/27/neverblock-unleashed/</link>
        </item>
    
        <item>
          <title>NeverBlock: Instant Scaling For Your Rails Apps</title>
          <description>&lt;p&gt;Today marks a milestone in the short history of NeverBlock. We have pushed a new release with lots of new features, mainly:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;NeverBlock now supports Ruby1.8.&lt;/li&gt;
&lt;li&gt;NeverBlock support for Thin and Mongrel servers.&lt;/li&gt;
&lt;li&gt;NeverBlock now supports Ruby on Rails.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Let's iterate over the above points and explain them in more detail.
&lt;/p&gt;

&lt;h3&gt;NeverBlock Now Supports Ruby 1.8&lt;/h3&gt;

&lt;p&gt;Utilizing Aman Gupta's Poor Man's Fibers we were able to add Ruby 1.8 support to NeverBlock. Thankfully this does not mean that applications written for NeverBlock now require full thread safety. Aman's implementation makes sure one thread is scheduled at a time. The fibers don't fight for CPU time so the solution is free of race conditions. The performance penalty is not very big and we were able to extract some very good figures during lab testing.&lt;/p&gt;
</description>
          <pubDate>Thu, 04 Sep 2008 10:49:00 GMT</pubDate>
          <guid>http://www.espace.com.eg/neverblock/blog/2008/09/04/neverblock-instant-scaling-for-your-rails-apps/</guid>
          <link>http://www.espace.com.eg/neverblock/blog/2008/09/04/neverblock-instant-scaling-for-your-rails-apps/</link>
        </item>
    
        <item>
          <title>NeverBlock MySQL Support  </title>
          <description>&lt;p&gt;We are pleased to announce the availability of a MySQL database driver for NeverBlock. This is the second database driver for NeverBlock after the PostgreSQL driver. We hope that with time, this family will grow.&lt;/p&gt;
&lt;p&gt;Of course the driver does all that you expect from a decent NeverBlock driver. It can do IO operations concurrently and in a transparent manner, thanks to NeverBlock. An interesting side effect emerged during the development of this driver. We were required to update the current MySQL driver to be able to do async operations. Once those were done, we discovered that the basic foundation for threaded support was there. Hence we went forward and implemented it (with help from Ruby gurus like Aman Gupta and Roger Pack).&lt;/p&gt;</description>
          <pubDate>Thu, 28 Aug 2008 10:45:27 GMT</pubDate>
          <guid>http://www.espace.com.eg/neverblock/blog/2008/08/28/neverblock-mysql-support/</guid>
          <link>http://www.espace.com.eg/neverblock/blog/2008/08/28/neverblock-mysql-support/</link>
        </item>
    
        <item>
          <title>NeverBlock and ActiveRecord, Concurrent DB Access Without Threads</title>
          <description>&lt;p&gt;
&lt;p&gt;A new neverblock_postgresql activerecord adapter &lt;a href=&quot;http://github.com/espace/activerecord-neverblock-postgresql-adapter/&quot;&gt;has been released&lt;/a&gt;. This new adapter makes it possible for applications using activerecord to utilize multiple connections to do queries in parallel in single threaded applications. This results in much higher performance and better &lt;span class=&quot;caps&quot;&gt;CPU&lt;/span&gt; utilization.&lt;/p&gt;
&lt;/p&gt;
&lt;h3&gt;What do I need to do?&lt;/h3&gt;
&lt;p&gt;If you were using the vanilla postgresql adapter you would&amp;#8217;ve initialized the connection as follows:&lt;/p&gt;
&lt;textarea name=&quot;code&quot; class=&quot;ruby&quot;&gt;
ActiveRecord::DB.establish_connection(
:adapter  =&amp;gt; &amp;#8220;postgresql&amp;#8221;,
:host     =&amp;gt; host,
:database =&amp;gt; database,
:username =&amp;gt; user,
:password =&amp;gt; pass
)
&lt;/textarea&gt;
&lt;p&gt;Now, to use NeverBlock all you need to do is:&lt;/p&gt;
&lt;textarea name=&quot;code&quot; class=&quot;ruby&quot;&gt;
ActiveRecord::DB.establish_connection(
:adapter     =&amp;gt; &amp;#8220;neverblock_postgresql&amp;#8221;, # neverblock_postgresql instead of neverblock
:host        =&amp;gt; host,
:database    =&amp;gt; database,
:username    =&amp;gt; user,
:password    =&amp;gt; pass,
:connections =&amp;gt; 8 # The number of connections to use, optional, defaults to 4
)
&lt;/textarea&gt;
&lt;p&gt;Note: you must have the pg, &lt;a href=&quot;http://github.com/espace/neverblock&quot;&gt;neverblock&lt;/a&gt;, &lt;a href=&quot;http://github.com/espace/neverblock-pg&quot;&gt;neverblock-pg&lt;/a&gt; and the &lt;a href=&quot;http://github.com/espace/activerecord-neverblock-postgresql-adapter&quot;&gt;activerecord-neverblock-postgresql-adapter&lt;/a&gt; gems installed&lt;/p&gt;
&lt;p&gt;This way the AR library will pick the gem and use neverblock_postgresql instead of the postgresql adapter&lt;/p&gt;</description>
          <pubDate>Sun, 24 Aug 2008 15:32:47 GMT</pubDate>
          <guid>http://www.espace.com.eg/neverblock/blog/2008/08/24/neverblock-and-activerecord-concurrent-db-access-without-threads/</guid>
          <link>http://www.espace.com.eg/neverblock/blog/2008/08/24/neverblock-and-activerecord-concurrent-db-access-without-threads/</link>
        </item>
    
        <item>
          <title>Fiber Pooling With NeverBlock</title>
          <description>&lt;p&gt;
&lt;p&gt;As mentioned in my &lt;a href=&quot;http://www.espace.com.eg/neverblock/blog/2008/08/19/an-introduction-to-fibers/&quot;&gt;earlier introduction about fibers&lt;/a&gt; I will be talking today about the fiber pooling features that are implemented as part of the &lt;a href=&quot;http://www.espace.com.eg/neverblock&quot;&gt;NeverBlock&lt;/a&gt; library.&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;The fiber pool is implemented as the NeverBlock::Pool::FiberPool class. The interface is super easy, with only one public method spawn that is. Here&amp;#8217;s an example&lt;/p&gt;
&lt;/p&gt;
&lt;textarea name=&quot;code&quot; class=&quot;ruby&quot;&gt;
&lt;ol&gt;
	&lt;li&gt;create a pool of 30 fibers&lt;br /&gt;
pool = NB::Pool::FiberPool.new(30)&lt;/li&gt;
&lt;/ol&gt;
&lt;ol&gt;
	&lt;li&gt;start spawinig fibers for use&lt;br /&gt;
pool.spawn do&lt;/li&gt;
	&lt;li&gt;do something useful in your fiber&lt;br /&gt;
end&lt;br /&gt;
&lt;/textarea&gt;&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;
The spawn method take only one argument, which is a code block to be run as a fiber. The spawned fiber will resume immediately (that is, if the pool managed to find us a free fiber immediately).&lt;br /&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;</description>
          <pubDate>Thu, 21 Aug 2008 12:18:10 GMT</pubDate>
          <guid>http://www.espace.com.eg/neverblock/blog/2008/08/21/fiber-pooling-with-neverblock/</guid>
          <link>http://www.espace.com.eg/neverblock/blog/2008/08/21/fiber-pooling-with-neverblock/</link>
        </item>
    
        <item>
          <title>An Introduction To Fibers</title>
          <description>&lt;p&gt;
&lt;p&gt;You know Thread, but have you heard of his red haired step child? Fiber? Fibers are a new and a note worthy addition to Ruby that appeared with 1.9. They are essentially code blocks that can be paused and resumed. They have to be forced to do so, unlike threads which are well mannered and just step aside when someone is in a hurry. Fibers are not a totally new ideas, they have been known for ages as Coroutines. But how does those fibers work? Let&amp;#8217;s start by the canonical example:&lt;/p&gt;
&lt;/p&gt;
&lt;textarea name=&quot;code&quot; class=&quot;ruby&quot;&gt;
&lt;p&gt;f = Fiber.new do&lt;br /&gt;
  3.times do |i|&lt;br /&gt;
    Fiber.yield i&lt;br /&gt;
  end&lt;br /&gt;
end&lt;/p&gt;
&lt;p&gt;puts f.resume #=&amp;gt; 0&lt;br /&gt;
puts f.resume #=&amp;gt; 1&lt;br /&gt;
puts f.resume #=&amp;gt; 2&lt;br /&gt;
puts f.resume #=&amp;gt; Error calling dead fiber&lt;/p&gt;
&lt;/textarea&gt;
&lt;p&gt;
&lt;p&gt;The very first time we called resume, the fiber sprang to life and the loop started, then when it hit Fiber.yield it returned to the caller with the value to the right side of the Fiber.yield (i in this case which is equal to zero in the first iteration).&lt;/p&gt;
&lt;p&gt;When resume is called again, the fiber continues &lt;strong&gt;from where it stopped&lt;/strong&gt; so the loop continues, i picks the value 1 and then yields it back. This continues till the fiber block is exhausted, at this point, calling resume on the fiber will raise an error.&lt;/p&gt;
&lt;/p&gt;</description>
          <pubDate>Tue, 19 Aug 2008 00:08:35 GMT</pubDate>
          <guid>http://www.espace.com.eg/neverblock/blog/2008/08/19/an-introduction-to-fibers/</guid>
          <link>http://www.espace.com.eg/neverblock/blog/2008/08/19/an-introduction-to-fibers/</link>
        </item>
    
    
  </channel>
</rss>

