MCPcopy Create free account
hub / github.com/langchain-ai/langgraph / get

Method get

libs/langgraph/langgraph/utils/queue.py:94–112  ·  view source on GitHub ↗

Remove and return an item from the queue. If optional args 'block' is true and 'timeout' is None (the default), block if necessary until an item is available. If 'timeout' is a non-negative number, it blocks at most 'timeout' seconds and raises the Empty exception if

(self, block=True, timeout=None)

Source from the content-addressed store, hash-verified

92 self._count.release()
93
94 def get(self, block=True, timeout=None):
95 """Remove and return an item from the queue.
96
97 If optional args 'block' is true and 'timeout' is None (the default),
98 block if necessary until an item is available. If 'timeout' is
99 a non-negative number, it blocks at most 'timeout' seconds and raises
100 the Empty exception if no item was available within that time.
101 Otherwise ('block' is false), return an item if one is immediately
102 available, else raise the Empty exception ('timeout' is ignored
103 in that case).
104 """
105 if timeout is not None and timeout < 0:
106 raise ValueError("'timeout' must be a non-negative number")
107 if not self._count.acquire(block, timeout):
108 raise queue.Empty
109 try:
110 return self._queue.popleft()
111 except IndexError:
112 raise queue.Empty
113
114 def wait(self, block=True, timeout=None):
115 """If queue is empty, wait until an item maybe is available,

Callers 13

patch_checkpoint_mapFunction · 0.45
merge_configsFunction · 0.45
patch_configFunction · 0.45
ensure_configFunction · 0.45
__init__Method · 0.45
invokeMethod · 0.45
ainvokeMethod · 0.45
invokeMethod · 0.45
ainvokeMethod · 0.45
streamMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected