Class: InstantRecord::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/instant_record/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



14
15
16
17
# File 'lib/instant_record/configuration.rb', line 14

def initialize
  @endpoint = DEFAULT_MOUNT_PATH
  @sync_interval = 3
end

Instance Attribute Details

#endpointObject

Where the authoritative Rails app's sync engine is mounted. Same-origin relative path by default; set an absolute URL for cross-origin dev setups (e.g. Vite on :5173 talking to Rails on :3000).



6
7
8
# File 'lib/instant_record/configuration.rb', line 6

def endpoint
  @endpoint
end

#sync_intervalObject

Base delay, in seconds, for retrying an outbox drain that did not get through. It is not a poll cadence: the browser has no heartbeat, because writes trigger their own sync pass and the change stream carries everything inbound. A client with an empty outbox makes no requests at all.



12
13
14
# File 'lib/instant_record/configuration.rb', line 12

def sync_interval
  @sync_interval
end