From e999df6632ace70d7762ff064d81bdfc91bc0519 Mon Sep 17 00:00:00 2001 From: noarkhh Date: Wed, 28 Aug 2024 11:25:40 +0200 Subject: [PATCH] Apply reviewers suggestion --- lib/membrane_rtsp/server.ex | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/membrane_rtsp/server.ex b/lib/membrane_rtsp/server.ex index fec49fe..7b227fd 100644 --- a/lib/membrane_rtsp/server.ex +++ b/lib/membrane_rtsp/server.ex @@ -26,6 +26,8 @@ defmodule Membrane.RTSP.Server do require Logger + alias Credo.CLI.Options + alias Hex.API.Key alias __MODULE__.Conn @type server_option :: @@ -75,11 +77,15 @@ defmodule Membrane.RTSP.Server do end @doc """ - Same as `GenServer.stop/2` + Stops the RTSP server. + + ## Options + - `timeout` - timeout of the server termination, passed to `GenServer.stop/3`. """ - @spec stop(pid(), reason :: term(), timeout()) :: :ok - def stop(server, reason \\ :normal, timeout \\ :infinity) do - GenServer.stop(server, reason, timeout) + @spec stop(pid(), timeout: timeout()) :: :ok + def stop(server, opts \\ []) do + timeout = Keyword.get(opts, :timeout, :infinity) + GenServer.stop(server, :normal, timeout) end @doc """