MCPcopy
hub / github.com/redis/redis-py / StaticPolicyResolver

Class StaticPolicyResolver

redis/commands/policies.py:277–291  ·  view source on GitHub ↗

Resolves policy from a static list of policy records.

Source from the content-addressed store, hash-verified

275
276
277class StaticPolicyResolver(BasePolicyResolver):
278 """
279 Resolves policy from a static list of policy records.
280 """
281
282 def __init__(self, fallback: Optional[PolicyResolver] = None) -> None:
283 """
284 Parameters:
285 fallback (Optional[PolicyResolver]): An optional fallback policy resolver
286 used for resolving policies if static policies are inadequate.
287 """
288 super().__init__(STATIC_POLICIES, fallback)
289
290 def with_fallback(self, fallback: "PolicyResolver") -> "PolicyResolver":
291 return StaticPolicyResolver(fallback)
292
293
294class AsyncDynamicPolicyResolver(AsyncBasePolicyResolver):

Callers 4

test_resolveMethod · 0.90
__init__Method · 0.90
__init__Method · 0.90
with_fallbackMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_resolveMethod · 0.72