@@ -23,3 +23,47 @@ class StorageClientOptions {
2323
2424 const StorageClientOptions ({this .retryAttempts = 0 });
2525}
26+
27+ /// {@template realtime_client_options}
28+ /// Options to pass to the RealtimeClient.
29+ /// {@endtemplate}
30+ class RealtimeClientOptions {
31+ /// How many events the RealtimeClient can push in a second
32+ ///
33+ /// Defaults to 10 events per second
34+ @Deprecated (
35+ 'Client side rate limit has been removed. This option will be ignored.' )
36+ final int ? eventsPerSecond;
37+
38+ /// Level of realtime server logs to be logged
39+ final RealtimeLogLevel ? logLevel;
40+
41+ /// the timeout to trigger push timeouts
42+ final Duration ? timeout;
43+
44+ /// The WebSocket implementation to use
45+ final WebSocketTransport ? webSocketTransport;
46+
47+ /// {@macro realtime_client_options}
48+ const RealtimeClientOptions ({
49+ this .eventsPerSecond,
50+ this .logLevel,
51+ this .timeout,
52+ this .webSocketTransport,
53+ });
54+
55+ RealtimeClientOptions copyWith ({
56+ int ? eventsPerSecond,
57+ RealtimeLogLevel ? logLevel,
58+ Duration ? timeout,
59+ WebSocketTransport ? webSocketTransport,
60+ }) {
61+ return RealtimeClientOptions (
62+ // ignore: deprecated_member_use_from_same_package
63+ eventsPerSecond: eventsPerSecond ?? this .eventsPerSecond,
64+ logLevel: logLevel ?? this .logLevel,
65+ timeout: timeout ?? this .timeout,
66+ webSocketTransport: webSocketTransport ?? this .webSocketTransport,
67+ );
68+ }
69+ }
0 commit comments