MCPcopy Create free account
hub / github.com/psf/cachecontrol / SeparateBodyBaseCache

Class SeparateBodyBaseCache

cachecontrol/cache.py:55–75  ·  view source on GitHub ↗

In this variant, the body is not stored mixed in with the metadata, but is passed in (as a bytes-like object) in a separate call to ``set_body()``. That is, the expected interaction pattern is:: cache.set(key, serialized_metadata) cache.set_body(key) Similarly, th

Source from the content-addressed store, hash-verified

53
54
55class SeparateBodyBaseCache(BaseCache):
56 """
57 In this variant, the body is not stored mixed in with the metadata, but is
58 passed in (as a bytes-like object) in a separate call to ``set_body()``.
59
60 That is, the expected interaction pattern is::
61
62 cache.set(key, serialized_metadata)
63 cache.set_body(key)
64
65 Similarly, the body should be loaded separately via ``get_body()``.
66 """
67
68 def set_body(self, key: str, body: bytes) -> None:
69 raise NotImplementedError()
70
71 def get_body(self, key: str) -> IO[bytes] | None:
72 """
73 Return the body as file-like object.
74 """
75 raise NotImplementedError()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…