Tuesday, February 21, 2012


Getting Familiar with IO

I have been checking out what is new with Dart for some time now, and I was quite interested to see that they released a formal library for IO. The server side is where a lot of my interest is for Dart, so I was anxious to try out some of the API.

As I became familiar with IO, I noticed that there was quite a bit of async calls happening. The testing I had coded up to this point was all synchronous calls, so I looked into support for async.

It turns out that there is a method called asyncTest that can be used. I have put together a 5 part presentation that illustrates how you can test async method calls.

The scenario for this post is based on a library I am coding now that is targeted as an add-on library to the existing http library that I retrieved from the bleeding edge repo. From spending time trying to learn Node.js, I decided that my library would be based on a similar library in Node called 'Formidable'. I originally attempted to port their Node.js library, but decided that eventually that it would be a good learning experience to follow their API, but provide my own Dart based implementation.

I am not finished the library (almost), but I wanted to show you how I did some of my testing early on. Here are the 5 parts;

Part 1
Part 2
Part 3
Part 4
Part 5

The GitHub repository for this project is here.

I will be releasing the library very soon, but in the meantime, you can get started testing your async calls.