Functions to create and execute time limiters.
Functions to create and execute time limiters.
(configure-registry! configs-map)
Overwrites the global registry with one that contains the configs-map.
configs-map is a map whose keys are names and vals are configs. When a time limiter is created, you may specify one of the names in this map to use as the config for that time limiter.
:default is a special name. It will be used as the config for time limiters that do not specify a config to use.
Overwrites the global registry with one that contains the configs-map. configs-map is a map whose keys are names and vals are configs. When a time limiter is created, you may specify one of the names in this map to use as the config for that time limiter. :default is a special name. It will be used as the config for time limiters that do not specify a config to use.
(execute time-limiter f & args)
Applies args to f within a context protected by the time limiter.
If the execution time exceeds the timeout duration, an exception is thrown.
Applies args to f within a context protected by the time limiter. If the execution time exceeds the timeout duration, an exception is thrown.
(name time-limiter)
Gets the name of the time limiter.
Gets the name of the time limiter.
The global time limiter and config registry.
The global time limiter and config registry.
(time-limiter name config)
Creates a time limiter with the specified name and config.
Creates a time limiter with the specified name and config.
(time-limiter! name)
(time-limiter! name config)
Creates or fetches a time limiter with the specified name and config and stores it in the global registry.
The config value can be either a config map or the name of a config map stored in the global registry.
If the time limiter already exists in the global registry, the config value is ignored.
Creates or fetches a time limiter with the specified name and config and stores it in the global registry. The config value can be either a config map or the name of a config map stored in the global registry. If the time limiter already exists in the global registry, the config value is ignored.
(with-time-limiter time-limiter & body)
Executes body within a context protected by the time limiter.
If the execution time exceeds the timeout duration, an exception is thrown.
time-limiter
is either a time limiter or the name of one in the global
registry. If you provide a name and a time limiter of that name does not
already exist in the global registry, one will be created with the :default
config.
Executes body within a context protected by the time limiter. If the execution time exceeds the timeout duration, an exception is thrown. `time-limiter` is either a time limiter or the name of one in the global registry. If you provide a name and a time limiter of that name does not already exist in the global registry, one will be created with the `:default` config.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close