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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: grafo
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: A library for building runnable asynchronous trees
5
5
  Author-email: "@paulomtts" <paulomtts@outlook.com>
6
6
  License: MIT
@@ -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 any(not worker.done() for worker in self._workers):
234
- if self._stop.is_set():
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()
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "grafo"
7
- version = "0.2.002"
7
+ version = "0.2.004"
8
8
  description = "A library for building runnable asynchronous trees"
9
9
  readme = "readme.md"
10
10
  authors = [
@@ -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