From 4a75ec4b98a8dd9961693e2679734c9b4783993a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Wala?= Date: Thu, 11 Apr 2024 17:04:21 +0200 Subject: [PATCH] Allow to pass GenServer opts to the PeerConnection --- lib/ex_webrtc/peer_connection.ex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ex_webrtc/peer_connection.ex b/lib/ex_webrtc/peer_connection.ex index 4fd59ad..d77a332 100644 --- a/lib/ex_webrtc/peer_connection.ex +++ b/lib/ex_webrtc/peer_connection.ex @@ -81,12 +81,12 @@ defmodule ExWebRTC.PeerConnection do |> Enum.filter(fn pid -> Process.alive?(pid) end) end - @spec start_link(Configuration.options()) :: GenServer.on_start() - def start_link(options \\ []) do - {controlling_process, options} = Keyword.pop(options, :controlling_process) + @spec start_link(Configuration.options(), GenServer.options()) :: GenServer.on_start() + def start_link(pc_opts \\ [], gen_server_opts \\ []) do + {controlling_process, pc_opts} = Keyword.pop(pc_opts, :controlling_process) controlling_process = controlling_process || self() - configuration = Configuration.from_options!(options) - GenServer.start_link(__MODULE__, {controlling_process, configuration}) + configuration = Configuration.from_options!(pc_opts) + GenServer.start_link(__MODULE__, {controlling_process, configuration}, gen_server_opts) end @spec start(Configuration.options()) :: GenServer.on_start()