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
+48-12Lines changed: 48 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,11 @@ class Client
43
43
44
44
def_delegators:auth,:client_id,:auth_options
45
45
46
-
# Custom environment to use such as 'sandbox' when testing the client library against an alternate Ably environment
46
+
# The hostname used to connect to Ably
47
+
# @return [String]
48
+
attr_reader:endpoint
49
+
50
+
# Custom environment to use such as 'sandbox' when testing the client library against an alternate Ably environment (deprecated)
47
51
# @return [String]
48
52
attr_reader:environment
49
53
@@ -135,7 +139,8 @@ class Client
135
139
# @option options [String] :token Token string or {Models::TokenDetails} used to authenticate requests
136
140
# @option options [String] :token_details {Models::TokenDetails} used to authenticate requests
137
141
# @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
142
+
# @option options [String] :endpoint Specify a routing policy or fully-qualified domain name to connect to Ably
143
+
# @option options [String] :environment Specify 'sandbox' when testing the client library against an alternate Ably environment (deprecated)
139
144
# @option options [Symbol] :protocol (:msgpack) Protocol used to communicate with Ably, :json and :msgpack currently supported
140
145
# @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
146
# @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 +193,6 @@ def initialize(options)
188
193
@agent=options.delete(:agent) || Ably::AGENT
189
194
@realtime_client=options.delete(:realtime_client)
190
195
@tls=options.delete_with_default(:tls,true)
191
-
@environment=options.delete(:environment)# nil is production
0 commit comments