public function receive($name, Closure $handler)
{
$response = [];
$response['jsonrpc'] = '2.0';
if ($this->hasChunks()) {
$result = $this->receiveChunks($name, $handler);
} else {
$result = $this->receiveSingle($name, $handler);
}
$response['result'] = $result;
return $response;
}