grafo 0.2.2__tar.gz → 0.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {grafo-0.2.2 → grafo-0.2.4}/PKG-INFO +1 -1
- {grafo-0.2.2 → grafo-0.2.4}/grafo/trees/executor.py +4 -7
- {grafo-0.2.2 → grafo-0.2.4}/pyproject.toml +1 -1
- {grafo-0.2.2 → grafo-0.2.4}/tests/test_async_tree.py +0 -3
- {grafo-0.2.2 → grafo-0.2.4}/LICENSE.txt +0 -0
- {grafo-0.2.2 → grafo-0.2.4}/MANIFEST.in +0 -0
- {grafo-0.2.2 → grafo-0.2.4}/grafo/__init__.py +0 -0
- {grafo-0.2.2 → grafo-0.2.4}/grafo/_internal/__init__.py +0 -0
- {grafo-0.2.2 → grafo-0.2.4}/grafo/_internal/logger.py +0 -0
- {grafo-0.2.2 → grafo-0.2.4}/grafo/trees/__init__.py +0 -0
- {grafo-0.2.2 → grafo-0.2.4}/grafo/trees/components.py +0 -0
- {grafo-0.2.2 → grafo-0.2.4}/grafo.egg-info/SOURCES.txt +0 -0
- {grafo-0.2.2 → grafo-0.2.4}/readme.md +0 -0
- {grafo-0.2.2 → grafo-0.2.4}/setup.cfg +0 -0
|
@@ -179,7 +179,7 @@ class AsyncTreeExecutor:
|
|
|
179
179
|
self._output.append(node)
|
|
180
180
|
except Exception as e:
|
|
181
181
|
self._stop.set()
|
|
182
|
-
logger.error(f"Error on {node}: {e}")
|
|
182
|
+
logger.error(f"Error on {node}: {e}", exc_info=True)
|
|
183
183
|
break
|
|
184
184
|
finally:
|
|
185
185
|
self._queue.task_done()
|
|
@@ -230,17 +230,14 @@ class AsyncTreeExecutor:
|
|
|
230
230
|
|
|
231
231
|
logger.debug(f"Running {'{}'.format(self._uuid) if self._uuid else ''}...")
|
|
232
232
|
|
|
233
|
-
while
|
|
234
|
-
if self.
|
|
233
|
+
while not self._stop.is_set():
|
|
234
|
+
if self._queue.empty():
|
|
235
235
|
break
|
|
236
|
-
|
|
237
236
|
while self._output:
|
|
238
237
|
node = self._output.pop(0)
|
|
239
238
|
yield node
|
|
240
239
|
|
|
241
|
-
await asyncio.sleep(
|
|
242
|
-
latency
|
|
243
|
-
) # ? REASON: Small delay to prevent busy-waiting
|
|
240
|
+
await asyncio.sleep(latency) # Small delay to prevent busy-waiting
|
|
244
241
|
|
|
245
242
|
await self._queue.join()
|
|
246
243
|
await self.stop_tree()
|
|
@@ -220,12 +220,9 @@ async def test_yielding():
|
|
|
220
220
|
tree = executor | nodes
|
|
221
221
|
results = []
|
|
222
222
|
|
|
223
|
-
stop_event = asyncio.Event()
|
|
224
223
|
async for node in tree.yielding():
|
|
225
224
|
results.append((node.uuid, node))
|
|
226
225
|
logger.debug(f"Yielded: {node}")
|
|
227
|
-
if node.uuid == grandchild_node2.uuid:
|
|
228
|
-
stop_event.set()
|
|
229
226
|
|
|
230
227
|
# Assert that all nodes have been processed and yielded
|
|
231
228
|
nodes_uuids = [
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|