MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / lpush

Method lpush

tests/scheduler/test_splitwise_scheduler.py:97–105  ·  view source on GitHub ↗
(self, key: str, *values: Any)

Source from the content-addressed store, hash-verified

95
96 # ------------------------------- list operations used by the scheduler
97 def lpush(self, key: str, *values: Any) -> int:
98 self._check_expiration(key)
99 items = list(values)
100 if not items:
101 return 0
102 bucket = self.storage.setdefault(key, [])
103 for value in items:
104 bucket.insert(0, value)
105 return len(bucket)
106
107 def rpop(self, key: str, count: Optional[int] = None) -> Optional[Any]:
108 self._check_expiration(key)

Callers 3

executeMethod · 0.45
lpushMethod · 0.45
lpushMethod · 0.45

Calls 1

_check_expirationMethod · 0.95

Tested by

no test coverage detected