Skip to main content

HS.BulkFHIR.Fetch.Util.RateLimiter

class HS.BulkFHIR.Fetch.Util.RateLimiter extends %Library.RegisteredObject

Basic rate limiter implementation, allows for calling functions to limit the number of requests made for a resource to a fixed number per second. This rate limit is honored across potentially multiple IRIS processes.

Method Inventory

Parameters

parameter global = ^IRIS.Temp.BFC.PureFHIR.RateLimiter;

Methods

method %OnNew(key As %String, maxRequestsPerSecond As %Integer) as %Status
@Input key Uniquely identifies what's being rate-limited. May be an HTTP endpoint or service registry name. @Input maxRequestsPerSecond Number of requests to be allowed for this key in a given second
classmethod Cleanup()
method WaitUntilAllowed() as %Numeric
@API Logs a request on the specified key. If the request would exceed the specified rate limit, will wait until the rate limit will not be exceeded. Then will allow the calling routine to proceed. This rate limit is honored across multiple IRIS processes. @Returns Time waited before allowing the request through

Inherited Members

Inherited Methods

FeedbackOpens in a new tab