MCPcopy
hub / github.com/ModelTC/LightLLM / pop

Method pop

lightllm/server/core/objs/out_token_circlequeue.py:76–86  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

74 self.tail = (self.tail + 1) % LIGHTLLM_OUT_TOKEN_QUEUE_SIZE
75
76 def pop(self) -> Tuple[str, int, bool, int]:
77 if self.is_empty():
78 raise Exception("Queue is empty")
79
80 # 移除元素
81 item: QueueItem = self.items[self.head]
82 result = item.get()
83
84 # 更新头部
85 self.head = (self.head + 1) % LIGHTLLM_OUT_TOKEN_QUEUE_SIZE
86 return result
87
88 def peek(self) -> Tuple[str, int, bool, int]:
89 if self.is_empty():

Callers 15

test_queue_push_and_popFunction · 0.95
test_queue_wrap_aroundFunction · 0.95
tuning_configsFunction · 0.80
fix_connectFunction · 0.80
health_checkFunction · 0.80
format_tgi_paramsFunction · 0.80
tgi_generate_implFunction · 0.80
tgi_generate_stream_implFunction · 0.80
compat_generateFunction · 0.80
tokensFunction · 0.80

Calls 2

is_emptyMethod · 0.95
getMethod · 0.45

Tested by 4

test_queue_push_and_popFunction · 0.76
test_queue_wrap_aroundFunction · 0.76