       :closed
 
   """
-  @spec pipeline(GenServer.server(), [command], Keyword.t()) ::
-          {:ok, [Redix.Protocol.redis_value()]} | {:error, atom | Redix.Error.t()}
+  @spec pipeline(connection(), [command()], keyword()) ::
+          {:ok, [Redix.Protocol.redis_value()]} | {:error, atom() | Redix.Error.t()}
   def pipeline(conn, commands, opts \\ []) do
     assert_valid_pipeline_commands(commands)
     Redix.Connection.pipeline(conn, commands, opts[:timeout] || @default_timeout)

      :closed

  """
  @spec command(GenServer.server(), command, Keyword.t()) ::
          :ok
          | {:ok, Redix.Protocol.redis_value()}
          | {:error, atom | Redix.Error.t() | Redix.ConnectionError.t()}
  def command(conn, command, opts \\ []) do
    case pipeline(conn, [command], opts) do
      {:ok, [%Redix.Error{} = error]} -> raise(error)

      ** (Redix.ConnectionError) :closed

  """
  @spec pipeline!(connection(), [command()], keyword()) ::
          [Redix.Protocol.redis_value()] | no_return()
  def pipeline!(conn, commands, opts \\ []) do
    case pipeline(conn, commands, opts) do
      {:ok, response} -> response
