MCPcopy
hub / github.com/ray-project/ray / decorator

Function decorator

python/ray/llm/_internal/common/utils/cloud_utils.py:529–544  ·  view source on GitHub ↗
(func: Callable[..., T])

Source from the content-addressed store, hash-verified

527 """
528
529 def decorator(func: Callable[..., T]) -> Callable[..., T]:
530 # Create a single cache instance for this function
531 cache = CloudObjectCache(
532 max_size=max_size,
533 fetch_fn=func,
534 missing_expire_seconds=missing_expire_seconds,
535 exists_expire_seconds=exists_expire_seconds,
536 missing_object_value=missing_object_value,
537 )
538
539 async def wrapper(*args, **kwargs):
540 # Extract the key from either first positional arg or object_uri kwarg
541 key = args[0] if args else kwargs.get("object_uri")
542 return await cache.aget(key)
543
544 return wrapper
545
546 return decorator

Callers

nothing calls this directly

Calls 1

CloudObjectCacheClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…