From 9b35b9c22f8412656d127ae8186e26972a181e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=9Aled=C5=BA?= Date: Sun, 14 Apr 2024 14:41:55 +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 d5ddb75..665645c 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()