function parsePayload($data)
{
    $data = explode("\n", $data);
    $headers = array();
    foreach ($data as $header) {
        $index = strpos($header, ":");
        if ($index > 5) {
            // sanity check
            $headers[substr($header, 0, $index)] = trim(substr($header, $index + 1));
        }
    }
    require_once 'Wildfire/Channel/Memory.php';
    $memoryChannel = new Wildfire_Channel_Memory();
    $receiver = new Receiver();
    $receiver->setChannel($memoryChannel);
    // listen to messages intended for the 'page' context
    $receiver->addId('http://registry.pinf.org/cadorn.org/insight/@meta/receiver/console/page/0');
    // listen to messages intended for the 'request' context
    $receiver->addId('http://registry.pinf.org/cadorn.org/insight/@meta/receiver/console/request/0');
    $memoryChannel->parseReceived($headers);
}