Polling Interval

Polling Interval

Overview  

During initialization, the SDK downloads the latest project configuration from the PageSense server and stores it in memory. To keep the project configuration up to date, the SDK periodically synchronises the in-memory configuration with the PageSense server. By default, synchronisation occurs every 10 seconds. The polling interval can be customized using the add_polling_interval() method.

Method  

add_polling_interval(interval: int)

Parameters  

Parameter
Type
Required
Description
interval
int
Yes
Polling interval in seconds.
 

Return Type  

Type
Description
PageSenseSDKOptions
Returns the same SDK options instance to support method chaining.
Usage Example  
from pagesense import PageSenseSDKOptions

sdk_options = (
    PageSenseSDKOptions()
        .add_polling_interval(300)
)

How It Works  

When the polling interval expires, the SDK automatically requests the latest project configuration from the PageSense server and updates its in-memory configuration. Subsequent experiment evaluations use the updated configuration without requiring the application to restart or recreate the SDK client.

Notes  

  • The default polling interval is 10 seconds.
  • The project configuration is maintained entirely in memory.
  • Polling begins automatically after SDK initialization.
  • No application restart is required for updated experiment configurations to take effect.

Best Practices  

  • Use the default polling interval unless your application has specific synchronisation requirements.
  • Avoid unnecessarily frequent polling intervals to reduce network overhead.
  • Reuse a single SDK client instance so that all requests use the same synchronised configuration.