Dartist/RedisClient — pull request #10 by enyo (2013-05-07 14:52:00+00:00)
Title: Refactor to latest dart version

# This branch is not ready yet! **DO NOT MERGE**

## Refactore RedisClient

I would dump the `RawRedisClient` in favor of a single unified `RedisClient` that has a `RawRedisCommands` object, which it invokes on the few functions that differ.

If somebody actually needs to access those raw functions, it's accessible through: `myRedisClient.raw.setget()`;

This way there's...

1. ...only one place that defines all the available methods (which is perfect for generating a good documentation API which I'll do as a next step),
2. ...no need for the interfaces anymore,
3. ...no copy past wraps of the "Native" Client,
4. ...a reduced risk of errors since there's much less repetitive code.

I'm half done with this, so I hope you agree. :)

## Drop the callback functions

I'd remove the callback functions, and go for futures instead.

The syntax would be (much like most of dart's IO code):

```dart
RedisClient.connect(connectionString).then((RedisClient client) {
// Do stuff
});
```

The same goes for the `onClosed` callback:

```dart
client.done.then(() => /* do stuff */);
```

This is pretty much the same API as dart's own [Socket](http://api.dartlang.org/docs/releases/latest/dart_io/Socket.html)