Wednesday, September 22, 2010

Javascript Separation of Concerns with Functions

‹prev | My Chain | next›

Up tonight, a bit of code clean-up. The main game.js file in my (fab) game has grown to 350+ lines of code as it now maintains a CouchDB, establishes a faye server (and some server side listeners), and responds to various resources necessary to drive the game. It has been difficult working with the code, so I start moving some of it to the lib directory.

I can write my dirt-simple Logger in lib/logger.js as:
var puts = require( "sys" ).puts;

Logger = {
level: 1,

debug: function(msg) { if (this.level<1) puts("[DEBUG] " + msg); },
info: function(msg) { if (this.level<2) puts("[INFO] " + msg); },
warn: function(msg) { if (this.level<3) puts("[WARN] " + msg); },
errror: function(msg) { if (this.level<4) puts("[ERROR] " + msg); }
};

module.exports = Logger;
The module.exports statement at the end is a commonjs mechanism for describing what will be imported into the main game.js code when it requires the module:
var Logger = require("./lib/logger");

Logger.info("Starting up...");
Easy enough.

I factor out the player store code as well:
var couchdb = require('node-couchdb/lib/couchdb'),
client = couchdb.createClient(5984, 'localhost'),
db = client.db('my-fab-game');

// Player local store
var players = (require("./lib/players")).init(db);
The code is starting to look better and the extraction process is going smoothly until I hit the
  // attach the extension ensuring player messages come from the same
// client that originally added player to the room
faye_server.addExtension(require("./lib/faye_server_auth"));
The problem with this faye extension is that it accesses the player store, which is now isolated in its own module.

Blech. It was almost nicer when everything was just in one big namespace and everything had access to everything. But, deep down, I know that will lead to poor separation of concerns. So I stop my pining for the bad old days and seek a mechanism to allow the message authorization to lookup players.

I could require the players module inside the message authorization module. I opt against that because the player code does much more (maybe too much more) than just lookup players in CouchDB—it also establishes faye subscriptions to update the data store in response to various published messages.

Instead, I pass a function (this is javascript, after all) into the message authorization init() method that can be used to look up players:
  // attach the extension ensuring player messages come from the same
// client that originally added player to the room
var auth = require("./lib/faye_server_auth").init(function () {
players.get.apply(players, arguments);
});

faye_server.addExtension(auth);
I have to be careful to return the object itself in init() because I need that object when calling faye_server.addExtension():
  init: function(player_get) {
this.player_get = player_get;
return this;
}
I can then use the player_get callback inside the message authorization module thusly:
    this.player_get(message.data.id, function(player) {
// Do stuff with the player
});
With that, I have my game.js source down to 180 lines—100 of which is HTML (fab) apps. I am not completely convinced that passing a function in by init() is inherently better than requiring the data store in the message authorization module. Still, if the message authorization module had direct access to the player store, the main code body would still have to pass in the database name. Unsure, I will leave it as-is, but make a note to reconsider in the future.

That is a nice stopping point for the night. Up tomorrow, I think that I am ready to merge back into master and return to some raphaël.js fun.


Day #234

Tuesday, September 21, 2010

More DRY with fab.js v0.5

‹prev | My Chain | next›

Up tonight I try to put my new fab.accept—an app written for the upcoming v0.5 release of fab.js—to some good use. Currently in my (fab) game, I have a player /status route that looks like:
 ( route, /^\/status/ )
( accept.HTML )
( PRE )
( player_status )
()
()
( accept.PLAIN )
(undefined, {headers: { "Content-Type": "text/plain"}})
( player_status )
()
()
Depending on the requested content type, the status of the players in the game are served up as HTML or plain text. The problem is that the HTML being served up is very small. Ideally I would like to serve it up as part of the same HTML template that the main player board is using:
  (route, /^\/board/)
( HTML )
( HEAD )
( TITLE )( "My (fab) Game" )()
( LINK, { href: "/stylesheets/board.css",
media: "screen",
rel: "stylesheet",
type: "text/css" } )
// Lots more style and script
( BODY )
// The actual body of the request
But how to re-use that? Back when I was first messing about with DRYing up my HTML, I found that I could have two different routes inside the same template (a rather unique fab.js feature):
  ( HTML )
( HEAD )
( TITLE )( "My (fab) Game" )()
( LINK, { href: "/stylesheets/board.css",
media: "screen",
rel: "stylesheet",
type: "text/css" } )
// Lots more style and script
()
( BODY )

(route, /^\/board/)
// the game board HTML

()

(route, /^\/status/)
( PRE )
( player_status )
()
()
I can no longer make use of that because the plain text response cannot include the HTML + HEAD + BODY tags that wrap both routes. Instead, I need to re-use the HTML, but only when the /status resource is requesting HTML. It turns out the upcoming version version of fab.js makes this easy by squirreling away partials in a local variable:
with ( fab )
with ( html ) head =

( fab )
( HEAD )
( TITLE )( "My (fab) Game" )()
( LINK, { href: "/stylesheets/board.css",
media: "screen",
rel: "stylesheet",
type: "text/css" } )
// Lots more style and script
()
();
I can then use that partial in both the /board route:
  (route, /^\/board/)
( HTML )
( head )
( BODY )
( FORM, { id: "login", method: "get" } )
( LABEL )
( "Name" )
( INPUT, { type: "text", name: "player" } )
()
( INPUT, { type: "submit", value: "Play" } )
()
( DIV, { id: "room-container" } )()
() // BODY

() // HTML
()
...and in the player /status route (body only when the client accepts HTML):
  ( route, /^\/status/ )
( accept.HTML )
( HTML )
( head )
( BODY )
( PRE )
( player_status )
()
()
()
()
( accept.PLAIN )
(undefined, {headers: { "Content-Type": "text/plain"}})
( player_status )
()
( "not found", { status: 404 } )
()
That is a surprisingly effective way to get simple partial support. Once again, I am left thinking that there may just be something to this upcoming version of fabjs.


Day #233

Monday, September 20, 2010

An npm Package of My Very Own (fab.accept)

‹prev | My Chain | next›

I have yet to create a npm package of my own. The fab.accept (fab) app from the other day affords me the perfect opportunity. It is an extremely small app, but that is one of the ideas behind the upcoming version of fab.js—small, modular apps.

First, I create a github repository for fab.accept. With that, I am ready to get started building my node package.

During this process, I make extensive use of the npm help subsystem. For instance, I read through npm help json to figure out how to write my package.json file:
{ "name": "fab.accept"
, "version": "0.0.1"
, "author": "Chris Strom"
, "description": "Simple (fab) app to respond to Accept HTTP headers"
, "homepage": "http://github.com/eee-c/fab.accept"
, "engines": ["node >= 0.2.0"]
, "main": "lib/main" }
There is also a dependencies attribute supported by npm. I opt not to use that here because it would require a version of fab.js (0.5) that is not yet in the npm registry.

After creating a lib/main.js with the code from the other day, I am ready to install locally:
cstrom@whitefall:~/repos/fab.accept$ npm install .
npm info it worked if it ends with ok
npm info version 0.1.27-12
npm info install fab.accept@0.0.1
npm info activate fab.accept@0.0.1
npm info build Success: fab.accept@0.0.1
npm ok
Nice! It took me a little while to root through the npm help json documentation to figure out what I needed, but once I had that sorted out, it was pretty easy to get my package ready to be installed.

After that, I use it in my (fab) game to make sure that it is working. I had left some debug code in there and accessed an array incorrectly. Once I have those issues resolved, I am ready to publish to the npm registry.

I am not sure what sort of authorization I need (do I need to send an email to get an account?). Only one way to find out:
cstrom@whitefall:~/repos/fab.accept$ npm publish .
npm info it worked if it ends with ok
npm info version 0.1.27-12
npm ERR! Failed PUT response undefined
npm ERR! Error: Cannot insert data into the registry without authorization
npm ERR! See: npm-adduser(1)
npm ERR! at request (/home/cstrom/.node_libraries/.npm/npm/0.1.27-12/package/lib/utils/registry/request.js:38:15)
npm ERR! at PUT (/home/cstrom/.node_libraries/.npm/npm/0.1.27-12/package/lib/utils/registry/request.js:129:34)
npm ERR! at Object.publish (/home/cstrom/.node_libraries/.npm/npm/0.1.27-12/package/lib/utils/registry/publish.js:49:7)
npm ERR! at /home/cstrom/.node_libraries/.npm/npm/0.1.27-12/package/lib/publish.js:15:14
npm ERR! at /home/cstrom/.node_libraries/.npm/npm/0.1.27-12/package/lib/cache.js:178:11
npm ERR! at cb (/home/cstrom/.node_libraries/.npm/npm/0.1.27-12/package/lib/utils/graceful-fs.js:28:9)
npm ERR! at node.js:769:9
npm ERR! try running: 'npm help publish'
npm ERR! Report this *entire* log at <http://github.com/isaacs/npm/issues>
npm ERR! or email it to <npm-@googlegroups.com>
npm not ok
Beautiful. It might not have worked, but it tells me exactly what I need to do:
cstrom@whitefall:~/repos/fab.accept$ npm adduser
Username: eee-c
Password:
Email: npm@eeecooks.com
npm info it worked if it ends with ok
npm info version 0.1.27-12
npm info adduser Authorized user eee-c
npm ok
And now...
cstrom@whitefall:~/repos/fab.accept$ npm publish .
npm info it worked if it ends with ok
npm info version 0.1.27-12
npm WARN Sending authorization over insecure channel.
npm WARN Sending authorization over insecure channel.
npm WARN Sending authorization over insecure channel.
npm info publish done with upload
npm info publish uploaded
npm ok
Damn, that was pretty easy. This npm stuff is all right!

The only thing left for me is to install from the npm registry to make sure it all works. Before I can do that, I need to remove my locally installed package:
cstrom@whitefall:~/.node_libraries$ npm rm fab.accept
npm info it worked if it ends with ok
npm info version 0.1.27-12
npm info uninstall safe to uninstall: fab.accept-0.0.1
npm info uninstall fab.accept-0.0.1 complete
npm ok
I also need to remove the previously installed package from the cache:
cstrom@whitefall:~/.node_libraries$ npm cache clean
npm info it worked if it ends with ok
npm info version 0.1.27-12
npm ok
If I do not remove from the cache, then I am not testing the downloaded package. I have no reason to believe that anything will not work, but, as long as I am testing this, I might as well test what I think I am testing.

With that, I can install from the npm registry:
cstrom@whitefall:~/.node_libraries$ npm install fab.accept
npm info it worked if it ends with ok
npm info version 0.1.27-12
npm info fetch http://registry.npmjs.org/fab.accept/-/fab.accept-0.0.1.tgz
npm info install fab.accept@0.0.1
npm info activate fab.accept@0.0.1
npm info build Success: fab.accept@0.0.1
npm ok
Success!

This npm is pretty darn cool. I went from no package to published package in a single night. I cannot ask for much more than that.


Day #232

Sunday, September 19, 2010

Picking Up After a Long Time Away

‹prev | My Chain | next›

Since I have been at Ruby DCamp this weekend, I thought it would make some sense to actually do some Ruby code. Way back when, I started this chain with the idea that I would come up with a mechanism to update EEE Cooks. The data resides in a CouchDB database. At least one way that I might accomplish that goal is via my couch_docs gem.

So I pick back up with my couch_docs. It has been a while, but I remember that I was partly through adding attachment support. How to pick it back quickly?

Happily, I left myself some clues:



Actually, I left myself a complete plan of what I need to accomplish:



Pending specs are incredibly powerful for this kind of thing. I use them even when I am not abandoning gems. If I am in the middle of working a problem at the end of the day, I will brain dump the remaining work in the form of pending specs.

The first pending spec that I will work today is:
      it "should guess the mime type"
That is nice and compact—no block or anything other cermony. Just a descrition of what I need to implement.

Unfortunately, when I look at the other specs in here, there is a ton of setup involved:
      it "should connect attachments by sub-directory name (foo.json => foo/)" do
everything = []
@it.each_document do |name, contents|
everything << [name, contents]
end

everything.
should include(['baz_with_attachments',
{'baz' => '3',
"_attachments" => { "spacer.gif" => {"data" => @spacer_b64} } }])
end
That feels like a lot of work (especially considering there is additional setup in before(:each) blocks). Instead of rewriting immediately, I try to work with the same stuff for my should-infer-mime-time pending spec:
      it "should guess the mime type" do
JSON.stub!(:parse).
and_return({ "baz" => "3",
"_attachments" => {
"spacer.gif" => "asdf",
}
})

everything = []
@it.each_document do |name, contents|
everything << [name, contents]
end

everything.
should include(['baz_with_attachments',
{ 'baz' => '3',
"_attachments" => {
"spacer.gif" => { "data" => @spacer_b64},
"baz.jpg" => "asdf",
"content_type" => "image/gif"
}
}])
end
Holy wow! That is a crazy amount of code just to test that content type. It passes, but clearly it is time to refactor.

With all tests passing, I can focus on the main culprit of my testing complexity, the each_document method:
    def each_document
Dir["#{couch_doc_dir}/*.json"].each do |filename|
id = File.basename(filename, '.json')
json = JSON.parse(File.new(filename).read)

if File.directory? "#{couch_doc_dir}/#{id}"
json["_attachments"] ||= { }
Dir["#{couch_doc_dir}/#{id}/*"].each do |attachment|
next unless File.file? attachment

attachment_name = File.basename(attachment)
type = mime_type(File.extname(attachment))
data = File.read(attachment)
json["_attachments"][attachment_name] =
{
"data" => Base64.encode64(data).gsub(/\n/, '')
}
if type
json["_attachments"][attachment_name].
merge!({"content_type" => type})
end

end
end

yield [ id, json ]
end
end
Yikes! I choose to believe that I knew there was way too much complexity the last time I worked this and that I intended to refactor. That is just silly.

Not coincidentally, the behavior for which I wrote my test is part of the complexity in each_document. Specifically, converting the file on the filesystem (including knowing the file type) can be factored out into a smaller method:
    def file_as_attachment(file)
type = mime_type(File.extname(file))
data = File.read(file)

attachment = {
"data" => Base64.encode64(data).gsub(/\n/, '')
}
if type
attachment.merge!({"content_type" => type})
end

attachment
end
That is still a largish method, but there is no looping and only a single conditional. That is pretty good. And much easier to test for the content type:
      it "should guess the mime type" do
File.stub!(:read).and_return("asdf")
Base64.stub!(:encode64).and_return("asdf")

@it.file_as_attachment("spacer.gif").
should == {
"data" => "asdf",
"content_type" => "image/gif"
}
end
That also makes for quicker BDDing of other mime types. Once I have everything working to my satisfaction, I load my fixtures into a test DB via the command line:
cstrom@whitefall:~/repos/couch_docs$ ./bin/couch-docs push http://localhost:5984/couch_docs_test ./fixtures/
Updating documents on CouchDB Server...
...and, checking in the DB:



Yay! The algorithm being used for mime inference is extraordinarily rudimentary, but it is well isolated in the mime_type method for future improvement. My main takeaway from today was that I was able to pick up the code very quickly, even after a long time away, thanks to pending specs. Those same specs are also pretty good for refactoring.


Day #231

Saturday, September 18, 2010

Spike fab.accept

‹prev | My Chain | next›

Up today, I would like to explore code re-use of (fab) apps in the upcoming version 0.5 of fab.js. In my (fab) game, I have a dashboard resource that returns that list of players currently in the room:
      (route, /^\/player_status/)
( PRE )
( player_status )
() // PRE
() // route
Looking at this is the browser, I see:



Simple enough.

Now that I think about it though, I really prefer to see this from curl. It is nice to have it in HTML so I would just as soon not have to choose from one or the other. Aha! Code reuse opportunity!

I create a new /status resource that produces a simple text response:
  ( route, /^\/status/ )
(undefined, {headers: { "Content-Type": "text/plain"}})
( player_status )
()
I can access that via curl and see:
cstrom@whitefall:~/repos/my_fab_game$ curl http://localhost:4011/status
bob
fred

Cool! Quick, dirty resuable (fab) apps are quick and easy to roll. But...

There is the problem of using two different routes to represent the same thing. I would much prefer requesting a single resource and inspectint Accept headers so that something like his would work:
  ( route, /^\/status/ )
( accept, "text/html" )
( PRE )
( player_status )
()
()
(accept, "text/plain")
(undefined, {headers: { "Content-Type": "text/plain"}})
( player_status )
()
()
For this, I will need to write a new (fab) app—fab.accept.

I start as simple as possible:
fab.accept = function() {
function accept( write, mime_type ) {
return fab.stream( function( yes ) {
return fab.stream( function( no ) {
return write( function( write, head ) {
// console.log(inspect(head));
return ( head.headers.accept == mime_type ? yes : no )( write, head );
})();

});
});
}

return accept;
}();
That is close to boiler-plate (fab) code for ternary apps. Like all (fab) apps, it returns a function (accept()) that also returns a function. To get the conditional branch, that function also returns a function. If the condition matches (e.g. the Accept header matches), then the first application,
denoted by the yes local variable, is executed. Otherwise, the no application is executed (e.g. the next fab.accept or a 404).

I did have to use a console.log() (commented out), but only because I can never remember the attributes of the headers in fab.js / node.js. With that, I am ready to test fab.accept from the command line. There is no easy way to get curl to request plain text or HTML. Instead, I need to set the "Accept" HTTP header attribute with the -H option:
cstrom@whitefall:~/repos/my_fab_game$ curl -H "Accept: text/html" http://localhost:4011/status
<pre>bob
fred

</pre>
Nice, the HTML version of the resource is served up in response to "Accept: text/html". Can I get the plaint text version?
cstrom@whitefall:~/repos/my_fab_game$ curl -H "Accept: text/plain" http://localhost:4011/status
bob
foo

Nice!

I still have to polish off fab.accept (and it would be nice to have some tests), but that is a nice stopping point for the night. It is pretty cool that it so easy to write these little things!


Day #230

Friday, September 17, 2010

How to Write Multiple Strings to a Single fab.stream

‹prev | My Chain | next›

I have been struggling a bit with an edge case of fab.stream—a (fab) app from the upcoming version 0.5 of fab.js. To explore that difficulty, I break down the problem into a very small (fab) app:
with ( fab )
with ( html )

( fab )

// Listen on the FAB port and establish the faye server
( listen, 0xFAB )

( PRE )
( callback_test )
() // /pre

();
As I found out last night, HTML (fab) apps that wrap content (like <pre>) do so by writing to the response stream, then reading from the upstream app response (e.g. callback_test above), then writing the closing tag to the response stream. The end result being that callback_test has upstream data in the response when it gets invoked.

It makes perfect sense but ended up causing trouble in certain situations. Specifically, when the upstream app writes multiple times to the response stream, then the HTML app will send multiple close tags.

This does not occur for simple apps. For instance if I grab a string foo from a function and write it to the response stream, then write the hard-coded string "bar" to the response stream like so:
function non_stream_test(write) {
var foo = function_that_returns_foo();
return write(foo)
("bar");
}
...It just works. Accessing this resource via curl returns:
cstrom@whitefall:~$ curl -N http://localhost:4011/
<pre>foobar</pre>
The foo + bar test is wrapped in the <pre> tag as expected.

Of course, I could also just as easily written to the response stream once like so:
function non_stream_test(write) {
var foo = function_that_returns_foo();
return write(foo + "bar");
}
My problem is that I think the first way is just so cool.

Anyhow.

As I mentioned, the above cases just work. Problems arise when dealing will callbacks—for example, looking up a list of players in a database. Since I am using Javascript, the database lookup expects to be called with function that it can invoke once it has retrieved the list of player. This is Javascript, so it is quite common.

In that case, I cannot return a write() of data. I only have access to the data inside the callback. Calling return inside the callback will return from the callback, not the function that originally requested the data. Fortunately, in v0.5 of fabjs, there is fab.stream to handle this.

Consider a silly callback that invokes the supplied function with a single argument, "foo":
function callback_with_foo(fn) { fn("foo") }
I can then get that value, along with "bar" by doing something like:
function callback_test(write) {
return write(function(write) {
return fab.stream(function(stream) {
callback_with_foo(function (foo) {
stream(write(foo));
stream(write("bar"));
stream(write());
});

});
});
}
This is the situation in which I will get a second closing <pre> tag:
cstrom@whitefall:~$ curl -N http://localhost:4011/
<pre>foo</pre>bar</pre>
Each stream(write()) still has the closing tag in the upstream just waiting to be sent back to the browser. And merrily sent it is.

For the past 3 nights, I have been banging my head against the proverbial wall trying to figure out a way around this. Today, it finally occurred to me that there is no need. I cannot think of a use case in which I would want to write twice in a callback and, even if I could, then it might warrant a bit more firepower than (fab) HTML apps. A perfectly cromulent solution is to simply accumulate the string data and then write it once:
function callback_test(write) {
return write(function(write) {
return fab.stream(function(stream) {
callback_with_foo(function (foo) {
stream(write(foo + "bar"));
stream(write());
});
});
});
}
(the second stream() with an empty write() signals to stream that it is done sending data)

With that, I get my properly wrapped text from a callback:
cstrom@whitefall:~$ curl -N http://localhost:4011/
<pre>foobar</pre>
Sometimes I can really obsess over very tiny, immaterial details. Such is my burden.

Tomorrow, I am definitely looking at something beside fab.stream!


Day #229

Thursday, September 16, 2010

The Case of the Extra Stream Data

‹prev | My Chain | next›

I continue my exploration of the upcoming version 0.5 of fab.js. I admit that I am getting a bit bogged down here, but I believe that understanding is slowing spreading. Hopefully tonight will prove to be a break through. Last night I explored the various degenerative cases of fab.stream. That provided some insight. Tonight I take a step back to see if I can apply that knowledge.

I continue to try to get my player_status (fab) app to embed itself inside HTML template apps:
      (route, /^\/player_status/)
( PRE )
( player_status )
() // PRE
() // route
That is a nice, easy-to-read representation of what I want to do. For the /player_status route, the output of the player_status (fab) app should be wrapped in a <pre> tag.

That is actually pretty easy to do—if the player data were static:
function player_status(write) {
return write("player_status 01")
("\n")
("player_status 02")
("\n")
("player_status 03")
("\n");
}
Here, player_status is a normal (fab) app, invoked with the write stream for the response. Invoking that stream with a string argument, "player_status 01", sends the data in the response and also returns the downstream listener in case there is more to say (i.e. "\n", "player_status 02", etc.).

With that, I get my expected 3 player statuses inside a <pre> tag:



My problem is that I need to grab the player status from CouchDB via node-couchdb. That means callbacks. Luckily, even in the infant stages of v0.5, fab.js supplies the fab.stream app to "hit the pause button" until the data is sent back.

How does this cause problems? Well, if I write multiple times to the fab.stream, I get output like this:



And HTML that ends with:
<pre>player_status 02</pre></body></html> 
</pre></body></html>player_status 03</pre></body></html>
</pre></body></html>player_status 01</pre></body></html>
</pre></body></html>
I get this even with simple versions without the callbacks, just multiple stream writes:
function player_status( write ) {
return write(function(write) {
return fab.stream(function(stream) {
stream(write("player_status 01"));
stream(write("\n"));
stream(write("player_status 02"));
stream(write("\n"));
stream(write("player_status 03"));
stream(write("\n"));
stream(write());degenerative
});
});
}
In all of the use-cases of fab.stream that I considered last night, I assumed that there was no queue—no initial list of data that would always be written after the explicit writes. That assumption is valid—the queue would be a second argument to fab.stream. Here, I am only supplying a single callback to be invoked—no queue.

My mistake was in not recognizing that there is a second way to build up the queue. The other means of building up the queue is through upstream data. Looking at the fab chain, there does not seem to be any upstream data:
      (route, /^\/player_status/)
( PRE )
( player_status )
() // PRE
() // route
The empty argument function calls should close the HTML tag (and the route) with no data, right? This is were I went wrong. The PRE (fab) app, like all HTML apps, actually creates upstream data beyond player_status. Thinking about it, it has to this in order to create the closing </pre> tag. These HTML (fab) apps write to the normal response stream, then reads from the player_status app while supplying that downstream data.

Taking a peak inside the fab.elem (fab) app, we can see where this occurs:
  function elem( name, isVoid ) {
return function( write, obj ) {
write = fab.concat( write )
write = write( "<" + name );
write = attrs( write )( obj )( ">" );

if ( isVoid ) return write;

return function read( arg ) {
if ( !arguments.length ) return write( "</" + name + ">" );

write = write.apply( undefined, arguments );
return read;

};
}
If the upstream app (player_status in this case) returns data, then write that data to the response. If the upstream is done with data (as indicated by no arguments), then write the closing tag.

The end result is that every time I stream new data back, these closing tags are coming along for the ride:
<pre>player_status 02</pre></body></html> 
</pre></body></html>player_status 03</pre></body></html>
</pre></body></html>player_status 01</pre></body></html>
</pre></body></html>
In the end, I can get away with (fab) apps with multiple streams only if I am sure that there is no upstream data on the way. Dang.

Armed with that knowledge, I do believe that I can resolve my issue, but I will leave that for tomorrow. I need to get some sleep before Ruby DCamp tomorrow.


Day #228