Method: CloudFS::Session#initialize

Defined in:
lib/cloudfs/session.rb

#initialize(end_point, clientid, secret, **http_conf) ⇒ Session

Returns a new instance of Session.

Parameters:

  • end_point (String)

    cloudfs application api server hostname

  • clientid (String)

    account clientid

  • secret (String)

    account secret

  • http_conf (Hash)

    RESTful connection configurations @option http_conf [Fixnum] :connect_timeout (60) for server handshake @option http_conf [Fixnum] :send_timeout (0) for send request, default is set to never, in order to support large uploads @option http_conf [Fixnum] :receive_timeout (120) for read timeout per block @option http_conf [Fixnum] :max_retry (3) for http 500 level errors @option http_conf [#<<] :http_debug (nil) to enable http debugging, example STDERR, STDOUT, File object opened with permissions to write

OPTIMIZE:

  • Configurable chunk size for chunked stream downloads, default is 16KB. Configurable keep alive timeout for persistent connections in connection pool, default is 15 seconds. Async api support

REVIEW:

  • optimum default values for http timeouts



87
88
89
90
91
92
93
# File 'lib/cloudfs/session.rb', line 87

def initialize(end_point, clientid, secret, ** http_conf)
  @http_debug = http_conf[:http_debug]
  @rest_adapter = RestAdapter.new(clientid, secret, end_point, ** http_conf)
  @unlinked = false
  @admin_credentials = {}
  @admin_credentials[:host] = end_point ? end_point : 'access.bitcasa.com'
end