powered by
hash with counter, to store requests, and count each time it is used
hash
(list) a list for internal use only, with elements key, sig, and count
key
sig
count
HashCounter$put()
HashCounter$get()
HashCounter$clone()
put()
Register a request by it's key
HashCounter$put(req_sig)
req_sig
an object of class RequestSignature
RequestSignature
nothing returned; registers request and iterates internal counter
get()
Get a request by key
HashCounter$get(req_sig)
(integer) the count of how many times the request has been made
clone()
The objects of this class are cloneable with this method.
HashCounter$clone(deep = FALSE)
deep
Whether to make a deep clone.
Other request-registry: RequestRegistry, request_registry()
RequestRegistry
request_registry()
x <- HashCounter$new() x$hash z <- RequestSignature$new(method = "get", uri = "https:/httpbin.org/get") x$put(z) x$hash x$get(z) x$put(z) x$get(z)
Run the code above in your browser using DataLab