public function withHandler(RequestHandlerInterface $handler): self
    {
        $pipeline = clone $this;
        $pipeline->handler = $handler;
        $pipeline->position = 0;

        return $pipeline;
    }
public function withHandler(RequestHandlerInterface $handler): self
    {
        $pipeline = clone $this;
        $pipeline->handler = $handler;
        $pipeline->position = 0;

        return $pipeline;
    }
public function withHandler ( RequestHandlerInterface $ handler ) : self { $ pipeline = clone $ this ; $ pipeline -> handler = $ handler ; $ pipeline -> position = 0 ; return $ pipeline ; }
Configures pipeline with target endpoint.

@param RequestHandlerInterface $handler

@return Pipeline

@throws PipelineException
Configures pipeline with target endpoint .