RateLimitWrap: Rate Limiting Wrapper

View source: R/RateLimitWrap_function.R

RateLimitWrapR Documentation

Rate Limiting Wrapper

Description

Takes any other function in the Companies House documentation and returns the same function with rate limiting. Uses trace to listen in on the headers of each HTTP request. As it's quite noisy, consider running with suppressMessages().

Usage

RateLimitWrap(func, ..., buffer = 5, silent = FALSE)

Arguments

func

The function you want to add rate limiting to

buffer

Optional. The amount of requests left before the wrapper will pause. Default is 5

silent

Optional. Suppresses printed messages

Value

A function with rate limiting added

Examples


PersonSearch.Rated <- RateLimitWrap(PersonSearch_limit_first)

PersonSearch.Rated(person, mkey)
PersonSearch.Rated(person, mkey, silent = TRUE)
suppressMessages(PersonSearch.Rated(person, mkey))


MatthewSmith430/CompaniesHouse documentation built on Jan. 28, 2024, 3:08 a.m.