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
+45-13Lines changed: 45 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -43,9 +43,9 @@ 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
47
# @return [String]
48
-
attr_reader:environment
48
+
attr_reader:endpoint
49
49
50
50
# The protocol configured for this client, either binary `:msgpack` or text based `:json`
51
51
# @return [Symbol]
@@ -135,7 +135,8 @@ class Client
135
135
# @option options [String] :token Token string or {Models::TokenDetails} used to authenticate requests
136
136
# @option options [String] :token_details {Models::TokenDetails} used to authenticate requests
137
137
# @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
138
+
# @option options [String] :endpoint Specify a routing policy or fully-qualified domain name to connect to Ably
139
+
# @option options [String] :environment Specify 'sandbox' when testing the client library against an alternate Ably environment (deprecated)
139
140
# @option options [Symbol] :protocol (:msgpack) Protocol used to communicate with Ably, :json and :msgpack currently supported
140
141
# @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
142
# @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 +189,6 @@ def initialize(options)
188
189
@agent=options.delete(:agent) || Ably::AGENT
189
190
@realtime_client=options.delete(:realtime_client)
190
191
@tls=options.delete_with_default(:tls,true)
191
-
@environment=options.delete(:environment)# nil is production
0 commit comments