-
Notifications
You must be signed in to change notification settings - Fork 17
/
client_options.dart
205 lines (175 loc) · 7.24 KB
/
client_options.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
import '../../logging/logging.dart';
import '../../realtime/realtime.dart';
import '../authentication.dart';
/// Ably library options used when instancing a REST or Realtime client library
///
/// https://docs.ably.com/client-lib-development-guide/features/#TO1
class ClientOptions extends AuthOptions {
/// initializes [ClientOptions] with log level set to info
ClientOptions() {
logLevel = LogLevel.info;
}
/// initializes [ClientOptions] with a key and log level set to info
///
/// See [AuthOptions.fromKey] for more details
ClientOptions.fromKey(String key) : super.fromKey(key) {
logLevel = LogLevel.info;
}
/// Optional clientId that can be used to specify the identity for this client
///
/// In most cases it is preferable to instead specific a clientId in the token
/// issued to this client.
/// https://docs.ably.com/client-lib-development-guide/features/#TO3a
String? clientId;
/// Custom log handler
///
/// https://docs.ably.com/client-lib-development-guide/features/#TO3c
LogHandler? logHandler;
/// Controls the level of verbosity of log messages from the library
///
/// Use constants from [LogLevel] to pass arguments
/// https://docs.ably.com/client-lib-development-guide/features/#TO3b
int? logLevel;
/// for development environments only
///
/// https://docs.ably.com/client-lib-development-guide/features/#TO3k2
String? restHost;
/// for development environments only
///
/// https://docs.ably.com/client-lib-development-guide/features/#TO3k3
String? realtimeHost;
/// for development environments only
///
/// https://docs.ably.com/client-lib-development-guide/features/#TO3k4
int? port;
/// Use a non-secure connection connection.
///
/// By default, a TLS connection is used to connect to Ably
/// https://docs.ably.com/client-lib-development-guide/features/#TO3d
bool? tls;
/// for development environments only
///
/// https://docs.ably.com/client-lib-development-guide/features/#TO3k5
int? tlsPort;
/// When true will automatically connect to Ably when library is instanced.
///
/// This is true by default. If false, will wait for an explicit
/// [ConnectionInterface]#connect to be called before connecting
/// https://docs.ably.com/client-lib-development-guide/features/#RTC1b
bool? autoConnect;
/// Decides whether to use MsgPack binary encoding or JSON encoding.
///
/// Defaults to true. If false, JSON encoding is used for REST and Realtime
/// operations, instead of the default binary msgpack encoding.
/// https://docs.ably.com/client-lib-development-guide/features/#TO3f
bool? useBinaryProtocol;
/// When true, messages will be queued whilst the connection is disconnected.
///
/// True by default.
/// https://docs.ably.com/client-lib-development-guide/features/#TO3g
bool? queueMessages;
/// When true, messages published on channels by this client will be
/// echoed back to this client.
///
/// This is true by default.
/// https://docs.ably.com/client-lib-development-guide/features/#TO3h
bool? echoMessages;
/// Can be used to explicitly recover a connection.
///
/// https://docs.ably.com/client-lib-development-guide/features/#TO3i
/// Also see https://www.ably.com/documentation/realtime/connection#connection-state-recovery
String? recover;
/// for development environments only
///
/// Use this only if you have been provided a dedicated environment by Ably
String? environment;
/// for development environments only
///
/// https://docs.ably.com/client-lib-development-guide/features/#TO3k6
List<String>? fallbackHosts;
/// for development environments only;
///
/// https://docs.ably.com/client-lib-development-guide/features/#TO3k7
@Deprecated('no alternative to this')
bool? fallbackHostsUseDefault;
/// When a TokenParams object is provided, it will override
/// the client library defaults described in TokenParams
///
/// https://docs.ably.com/client-lib-development-guide/features/#TO3j11
TokenParams? defaultTokenParams;
/// When the connection enters the [ConnectionState.disconnected] state,
/// after this delay in milliseconds, if the state is still
/// [ConnectionState.disconnected], the client library will
/// attempt to reconnect automatically
///
/// default 15,000 (15 seconds)
/// https://docs.ably.com/client-lib-development-guide/features/#TO3l1
int? disconnectedRetryTimeout;
/// When the connection enters the [ConnectionState.suspended] state,
/// after this delay in milliseconds, if the state is still
/// [ConnectionState.suspended], the client library will
/// attempt to reconnect automatically
///
/// default 30,000 (30 seconds)
/// https://docs.ably.com/client-lib-development-guide/features/#TO3l2
int? suspendedRetryTimeout;
/// https://docs.ably.com/client-lib-development-guide/features/#TO3n
bool? idempotentRestPublishing;
/// Additional parameters to be sent in the querystring when initiating
/// a realtime connection
///
/// https://docs.ably.com/client-lib-development-guide/features/#RTC1f
Map<String, String>? transportParams;
/// Timeout for opening the connection, available in the client library
/// if supported by the transport
///
/// default 4,000 (4s)
/// https://docs.ably.com/client-lib-development-guide/features/#RTC1f
int? httpOpenTimeout;
/// Timeout for any single HTTP request and response
///
/// default 10,000 (10s)
/// https://docs.ably.com/client-lib-development-guide/features/#TO3l4
int? httpRequestTimeout;
/// Max number of fallback hosts to use as a fallback when an HTTP request
/// to the primary host is unreachable or indicates that it is unserviceable
///
/// default 3
/// https://docs.ably.com/client-lib-development-guide/features/#TO3l5
int? httpMaxRetryCount;
/// When a realtime client library is establishing a connection with Ably,
/// or sending a HEARTBEAT, CONNECT, ATTACH, DETACH or CLOSE ProtocolMessage
/// to Ably, this is the amount of time that the client library will wait
/// before considering that request as failed and triggering a suitable
/// failure condition
///
/// default 10s
/// https://docs.ably.com/client-lib-development-guide/features/#DF1b
int? realtimeRequestTimeout;
/// After a failed request to the default endpoint,
/// followed by a successful request to a fallback endpoint,
/// the period in milliseconds before HTTP requests are retried
/// against the default endpoint
///
/// default 600000 (10 minutes)
/// https://docs.ably.com/client-lib-development-guide/features/#TO3l10
int? fallbackRetryTimeout;
/// When a channel becomes [ChannelState.suspended] following a server
/// initiated [ChannelState.detached], after this delay in milliseconds,
/// if the channel is still [ChannelState.suspended] and the connection
/// is [ConnectionState.connected], the client library will attempt
/// to re-attach the channel automatically
///
/// default 15,000 (15s)
/// https://docs.ably.com/client-lib-development-guide/features/#TO3l7
int? channelRetryTimeout;
// TODO(tiholic) unimplemented:
//
// (TO3m) logExceptionReportingUrl
// (TO3l6) httpMaxRetryDuration
// (TO3l8) maxMessageSize
// (TO3l9) maxFrameSize
// (TO3o) plugins
// (TO3p) addRequestIds
// (DF1a) connectionStateTtl
}