From 4b6c0e31385f5f27a151088c0a2b614495c4e589 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Thu, 14 Oct 2021 12:47:50 -0400 Subject: initial commit, including theme --- content/posts/2003-09-27-fam-ruby-other.html | 63 ++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 content/posts/2003-09-27-fam-ruby-other.html (limited to 'content/posts/2003-09-27-fam-ruby-other.html') diff --git a/content/posts/2003-09-27-fam-ruby-other.html b/content/posts/2003-09-27-fam-ruby-other.html new file mode 100644 index 0000000..169ff65 --- /dev/null +++ b/content/posts/2003-09-27-fam-ruby-other.html @@ -0,0 +1,63 @@ +--- +date: "2003-09-27T13:08:57Z" +title: FAM-Ruby, Other +--- + +

+Released version 0.1.3 of FAM-Ruby. This release +consists entirely of a small one line patch from Jon Bernard, so I took the +opportunity to import FAM-Ruby into CVS under the module fam-ruby. +

+ +

+Raggle now has a half-assed (but working!) implementation of parallel feed grabbing. Basically each feed grab is forked off in it's own thread, which means you can grab an arbitrary number of feeds in parallel (limited by CPU speed and bandwidth, of course). This implementation is in CVS, but don't rush to try it just yet; it seems to have dug up some intermittent concurrency issue in either REXML, Ruby, or Raggle. I've marked all the "destructive" regions of feed grabbing threads as critical regions, but I haven't narrowed down the problem just yet. My hunch is that it's either a subtle error in the Ruby GC, or a concurrency issue in REXML. The latter seems strange to me, since REXML is written in pure Ruby and, as far as I know, doesn't use threads internally. I guess we'll see. +

+ +

+Richard (richlowe) and I were +talking about passing events between machines, and he suggested that I +use DRb. +I've played around with DRb a bit before, but for some reason using RMI for mundane things — in this case, a /whatsPlaying alias in Irssi which queries the XMMS process on my workstation — never occurred to me. What I really love about this solution is how absurdly simple it is. Here's the code for the "server": +

+ +
+require 'drb'
+require 'xmms'
+
+DRb::start_service('druby://picard:2345', Xmms::Remote::new)
+DRb::thread.join
+
+ +

+The "client" is ridiculously simple as well. Here it is: +

+ +
+require 'drb'
+
+DRb::start_service
+if r = DRbObject.new(nil, 'druby://picard:2345')
+  puts "Playing \"#{r.title}\"."
+end
+
+ +

+Finally, the one-liner in Irssi to +tie the whole thing together: +

+ +
+/alias whatsPlaying exec - -o bin/whatsPlaying.rb
+
+ +

+In case anyone is wondering, this is one of the things I really like +about Ruby; solutions tend to be +simple, short, and legible. Okay, </advocacy>. I'm +out for now. +

+ -- cgit v1.2.3