private function createCacheAdapter()
    {
        $extraData = &$this->extraData;

        return new CallbackAdapter(function (Request $request) use (&$extraData) {

            $poolName = 'default';

            if (isset($this->source['cache']['pool'])) {
                $poolName = $this->source['cache']['pool'];
            }

            $adapter = new CacheAdapter(
                $this->registry->getCachePool($poolName),
                new HttpApiAdapter(),
                function (Request $request) {
                    $data = $request->getData();

                    return $this->registry->generateCacheItemKey(
                        sprintf('%s.%s.%s', $data['service'], $data['group'], $data['action']),
                        $data['arguments']
                    );
                }
            );

            $response = $adapter->receive($request);

            $extraData = $response->getHeaders();

            return $response;
        });
    }