lib/submodules/ably-ruby/lib/ably/realtime/client.rb in ably-rest-0.8.14 vs lib/submodules/ably-ruby/lib/ably/realtime/client.rb in ably-rest-0.8.15
- old
+ new
@@ -66,10 +66,13 @@
# Creates a {Ably::Realtime::Client Realtime Client} and configures the {Ably::Auth} object for the connection.
#
# @param (see Ably::Rest::Client#initialize)
# @option options (see Ably::Rest::Client#initialize)
+ # @option options [Proc] :auth_callback when provided, the Proc will be called with the token params hash as the first argument, whenever a new token is required.
+ # Whilst the proc is called synchronously, it does not block the EventMachine reactor as it is run in a separate thread.
+ # The Proc should return a token string, {Ably::Models::TokenDetails} or JSON equivalent, {Ably::Models::TokenRequest} or JSON equivalent
# @option options [Boolean] :queue_messages If false, this disables the default behaviour whereby the library queues messages on a connection in the disconnected or connecting states
# @option options [Boolean] :echo_messages If false, prevents messages originating from this connection being echoed back on the same connection
# @option options [String] :recover When a recover option is specified a connection inherits the state of a previous connection that may have existed under a different instance of the Realtime library, please refer to the API documentation for further information on connection state recovery
# @option options [Boolean] :auto_connect By default as soon as the client library is instantiated it will connect to Ably. You can optionally set this to false and explicitly connect.
#
@@ -140,9 +143,19 @@
end
# (see Ably::Realtime::Connection#connect)
def connect(&block)
connection.connect(&block)
+ end
+
+ # (see Ably::Rest::Client#request)
+ # @yield [Ably::Models::HttpPaginatedResponse<>] An Array of Stats
+ #
+ # @return [Ably::Util::SafeDeferrable]
+ def request(method, path, params = {}, body = nil, headers = {}, &callback)
+ async_wrap(callback) do
+ rest_client.request(method, path, params, body, headers, async_blocking_operations: true)
+ end
end
# @!attribute [r] endpoint
# @return [URI::Generic] Default Ably Realtime endpoint used for all requests
def endpoint