You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use endpoint as default connection option (ADR-119)
This implements ADR-119[1], which specifies the client connection
options to update requests to the endpoints implemented as part of
ADR-042[2].
The endpoint may be one of the following:
* a routing policy name (such as `main`)
* a nonprod routing policy name (such as `nonprod:sandbox`)
* a FQDN such as `foo.example.com`
The endpoint option is not valid with any of environment, restHost or
realtimeHost, but we still intend to support the legacy options.
If the client has been configured to use any of these legacy options,
then they should continue to work in the same way, using the same
primary and fallback hostnames.
If the client has not been explicitly configured, then the hostnames
will change to the new `ably.net` domain when the package is upgraded.
[1] https://ably.atlassian.net/wiki/spaces/ENG/pages/3428810778/ADR-119+ClientOptions+for+new+DNS+structure
[2] https://ably.atlassian.net/wiki/spaces/ENG/pages/1791754276/ADR-042+DNS+Restructure
Copy file name to clipboardExpand all lines: lib/ably/rest/client.rb
+46-15Lines changed: 46 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,6 @@ class Client
18
18
extendForwardable
19
19
usingAbly::Util::AblyExtensions
20
20
21
-
# Default Ably domain for REST
22
-
DOMAIN='rest.ably.io'
23
-
24
21
MAX_MESSAGE_SIZE=65536# See spec TO3l8
25
22
MAX_FRAME_SIZE=524288# See spec TO3l8
26
23
@@ -43,7 +40,11 @@ class Client
43
40
44
41
def_delegators:auth,:client_id,:auth_options
45
42
46
-
# Custom environment to use such as 'sandbox' when testing the client library against an alternate Ably environment
43
+
# The hostname used to connect to Ably
44
+
# @return [String]
45
+
attr_reader:endpoint
46
+
47
+
# Custom environment to use such as 'sandbox' when testing the client library against an alternate Ably environment (deprecated)
47
48
# @return [String]
48
49
attr_reader:environment
49
50
@@ -135,7 +136,8 @@ class Client
135
136
# @option options [String] :token Token string or {Models::TokenDetails} used to authenticate requests
136
137
# @option options [String] :token_details {Models::TokenDetails} used to authenticate requests
137
138
# @option options [Boolean] :use_token_auth Will force Basic Auth if set to false, and Token auth if set to true
138
-
# @option options [String] :environment Specify 'sandbox' when testing the client library against an alternate Ably environment
139
+
# @option options [String] :endpoint Specify a routing policy or fully-qualified domain name to connect to Ably
140
+
# @option options [String] :environment Specify 'sandbox' when testing the client library against an alternate Ably environment (deprecated)
139
141
# @option options [Symbol] :protocol (:msgpack) Protocol used to communicate with Ably, :json and :msgpack currently supported
140
142
# @option options [Boolean] :use_binary_protocol (true) When true will use the MessagePack binary protocol, when false it will use JSON encoding. This option will overide :protocol option
141
143
# @option options [Logger::Severity,Symbol] :log_level (Logger::WARN) Log level for the standard Logger that outputs to STDOUT. Can be set to :fatal (Logger::FATAL), :error (Logger::ERROR), :warn (Logger::WARN), :info (Logger::INFO), :debug (Logger::DEBUG) or :none
@@ -188,8 +190,6 @@ def initialize(options)
188
190
@agent=options.delete(:agent) || Ably::AGENT
189
191
@realtime_client=options.delete(:realtime_client)
190
192
@tls=options.delete_with_default(:tls,true)
191
-
@environment=options.delete(:environment)# nil is production
0 commit comments