liuggio/statsd-php-client — pull request #23 by liuggio (2013-12-17 23:50:47+00:00)
Title: [WIP] [2.0] alpha release - packet Reducer as decorator, Hadler to solve buffering, and simplify usage

### The version 2.0

Has the handler, that can be used to facilitate the sending liuggio/StatsDClientBundle#40,
or also using it to buffer all packets until closing the handler, related to https://github.com/liuggio/StatsDClientBundle/issues/37

This fix also #21.

### Example
```php
$sender = SocketSender('localhost', 8126) // new sender using socket.
$client = new StatsdClient($sender);
// add decorator to reduce packets.
$client = new PacketReducer($client);
$factory = new StatsdDataFactory();

// BufferHandler will set the data into the buffer until `send` or `close` or `_deconstruct` is called
$bufferHandler = new BufferHandler($client, $factory);
$bufferHandler->timing('usageTime', 100);

// SendHandler will send immediately the data.
$sendHandler = new SendHandler($client, $factory);
$sendHandler->timing('usageTime', 100);
```