<?php

declare (strict_types=1);
namespace GDAVSCOPE\Amp\Http\Client\Connection;

use GDAVSCOPE\Amp\Cancellation;
use GDAVSCOPE\Amp\Http\Client\Request;
use function GDAVSCOPE\Amp\Http\Client\events;
interface ConnectionFactory
{
    /**
     * Creates a new connection.
     *
     * The implementation should call appropriate event handlers via {@see events()}.
     */
    public function create(Request $request, Cancellation $cancellation): Connection;
}
