Learn R Programming

pixr (version 0.1.0)

pix_timeout: Get or Set API Request Timeout

Description

Get or set the timeout for API requests. The default timeout is 120 seconds. The BCB API can be slow for large queries, so a generous timeout is recommended.

Usage

pix_timeout(seconds = NULL)

Value

  • pix_timeout(): Returns the current timeout in seconds (invisibly when setting).

  • When called with seconds, sets the timeout and returns the new value invisibly.

Arguments

seconds

Integer; timeout in seconds. If NULL, returns the current timeout.

Examples

Run this code
# Get current timeout
pix_timeout()

# Set timeout to 180 seconds (3 minutes)
pix_timeout(180)

# Set timeout to 60 seconds
pix_timeout(60)

# Reset to default (120 seconds)
pix_timeout(120)

Run the code above in your browser using DataLab