Skip to content

Commit de5904a

Browse files
author
john
committed
supabase: Allow setting timeout of RealtimeClient.
1 parent 408e816 commit de5904a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

packages/supabase/lib/src/realtime_client_options.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ class RealtimeClientOptions {
1414
/// Level of realtime server logs to to be logged
1515
final RealtimeLogLevel? logLevel;
1616

17+
/// the timeout to trigger push timeouts
18+
final Duration? timeout;
19+
1720
/// {@macro realtime_client_options}
1821
const RealtimeClientOptions({
1922
this.eventsPerSecond,
2023
this.logLevel,
24+
this.timeout,
2125
});
2226
}

packages/supabase/lib/src/supabase_client.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:http/http.dart';
44
import 'package:supabase/src/constants.dart';
55
import 'package:supabase/supabase.dart';
66
import 'package:yet_another_json_isolate/yet_another_json_isolate.dart';
7+
import 'package:realtime_client/src/constants.dart' as realtime_client;
78

89
import 'auth_http_client.dart';
910
import 'counter.dart';
@@ -263,6 +264,7 @@ class SupabaseClient {
263264
headers: {'apikey': _supabaseKey, ...headers},
264265
logLevel: options.logLevel,
265266
httpClient: _authHttpClient,
267+
timeout: options.timeout ?? realtime_client.Constants.defaultTimeout,
266268
);
267269
}
268270

0 commit comments

Comments
 (0)