Class: DropboxApi::Endpoints::Files::ListFolderLongpoll

Inherits:
RpcNotify show all
Includes:
OptionsValidator
Defined in:
lib/dropbox_api/endpoints/files/list_folder_longpoll.rb

Constant Summary collapse

Method =
:post
Path =
"/2/files/list_folder/longpoll".freeze
ResultType =
DropboxApi::Results::ListFolderLongpollResult
ErrorType =
DropboxApi::Errors::ListFolderLongpollError

Instance Method Summary collapse

Methods included from OptionsValidator

#validate_options

Methods inherited from RpcNotify

#initialize

Methods inherited from Rpc

#build_request, #initialize, #request_body

Methods inherited from Base

add_endpoint

Constructor Details

This class inherits a constructor from DropboxApi::Endpoints::RpcNotify

Instance Method Details

#list_folder_longpoll(cursor, options = {}) ⇒ Object

A longpoll endpoint to wait for changes on an account. In conjunction with list_folder, this call gives you a low-latency way to monitor an account for file changes. The connection will block until there are changes available or a timeout occurs. This endpoint is useful mostly for client-side apps. If you're looking for server-side notifications, check out our webhooks documentation.

Parameters:

  • cursor (String)

    A cursor as returned by list_folder or list_folder_continue.

Options Hash (options):

  • timeout (Numeric)

    A timeout in seconds. The request will block for at most this length of time, plus up to 90 seconds of random jitter added to avoid the thundering herd problem. Care should be taken when using this parameter, as some network infrastructure does not support long timeouts. The default for this field is 30.



24
25
26
27
28
29
30
31
32
33
# File 'lib/dropbox_api/endpoints/files/list_folder_longpoll.rb', line 24

add_endpoint :list_folder_longpoll do |cursor, options = {}|
  validate_options([
    :timeout
  ], options)
  options[:timeout] ||= 30

  perform_request options.merge({
    :cursor => cursor
  })
end