public function publish(Listener $listener, array $input)
    {
        $queues = $this->publisher->queued();

        try {
            $this->publisher->connect($input);
        } catch (ServerException $e) {
            Log::emergency($e);
            $this->session->forget('antares.ftp');

            return $listener->publishingHasFailed(['error' => $e->getMessage()]);
        }

        $this->session->put('antares.ftp', $input);

        if ($this->publisher->connected() && !empty($queues)) {
            $this->publisher->execute();
        }

        return $listener->publishingHasSucceed();
    }