Allow the ctor SupabaseClient to set timeout to a RealtimeClient.
What is the current behavior?
Due to the fact the timeout is a final field in RealtimeClient, we cannot change its value after the RealtimeClient is created, and because the RealtimeClient is created in the ctor of SupabaseClient, there is no way for users to set the timeout.
What is the new behavior?
The new behavior allow us to set the timeout of the RealtimeClient like this:
My app is connecting Supabase through Tor proxy. It's normal to cost 10 or more seconds to build a WebSocket connection. However, the current default timeout of RealtimeClient is 10 seconds, which is too short, and very often leads to result of no WebSocket connection is created, and therefore no realtime feature is provided.
What kind of change does this PR introduce?
Allow the ctor
SupabaseClient
to settimeout
to aRealtimeClient
.What is the current behavior?
Due to the fact the
timeout
is a final field inRealtimeClient
, we cannot change its value after theRealtimeClient
is created, and because theRealtimeClient
is created in the ctor ofSupabaseClient
, there is no way for users to set the timeout.What is the new behavior?
The new behavior allow us to set the timeout of the
RealtimeClient
like this:Additional context
My app is connecting Supabase through Tor proxy. It's normal to cost 10 or more seconds to build a WebSocket connection. However, the current default timeout of
RealtimeClient
is 10 seconds, which is too short, and very often leads to result of no WebSocket connection is created, and therefore no realtime feature is provided.