container = $container; $this->logger = $container->get(StdoutLoggerInterface::class); $this->name = $name; } /** * Get a connection from request context. */ public function connection(): ?ConnectionInterface { if (CoroutineContext::has($this->name)) { return CoroutineContext::get($this->name); } return null; } public function set(ConnectionInterface $connection): void { CoroutineContext::set($this->name, $connection); } }