public function getContentTypeByName($name, $space, array $options = [])
    {
        $envelope = $this->findEnvelopeForSpace($space);
        $promise = coroutine(
            function () use ($name, $space, $envelope, $options) {
                $contentTypeFromEnvelope = $envelope->findContentTypeByName($name);
                if ($contentTypeFromEnvelope) {
                    yield promise_for($contentTypeFromEnvelope);
                    return;
                }
                $contentTypes = (yield $this->getContentTypes([], $space, array_merge($options, ['async' => true])));
                $foundContentType = null;
                foreach ($contentTypes as $contentType) {
                    if ($contentType->getName() === $name) {
                        $foundContentType = $contentType;
                    }
                    $envelope->insertContentType($contentType);
                }

                yield $foundContentType;
            }
        );

        return (isset($options['async']) && $options['async']) ? $promise : $promise->wait();
    }