architxt.bucket#
Classes
A scalable, persistent, set-like container for |
- class architxt.bucket.TreeBucket[source]#
Bases:
ABC
,MutableSet
,Collection
A scalable, persistent, set-like container for
Tree
.The
TreeBucket
behaves like a mutable set and provides persistent storage. It is designed to handle large collections of trees efficiently, supporting standard set operations and transactional updates.Transaction Management
Bucket automatically handles transactions when adding or removing
Tree
from the bucket.If a
Tree
is modified after being added to the bucket, you must callcommit()
to persist those changes.
Available Implementations
digraph inheritance999ed8d026 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "TreeBucket" [URL="#architxt.bucket.TreeBucket",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A scalable, persistent, set-like container for :py:class:`~architxt.tree.Tree`."]; "ZODBTreeBucket" [URL="architxt.bucket.zodb.html#architxt.bucket.zodb.ZODBTreeBucket",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A persistent, scalable container for :py:class:`~architxt.tree.Tree` objects backed by ZODB and RelStorage using SQLite."]; "TreeBucket" -> "ZODBTreeBucket" [arrowsize=0.5,style="setlinewidth(0.5)"]; }- async async_update(trees, batch_size=BATCH_SIZE)[source]#
Asynchronously add multiple
Tree
to the bucket.This method mirrors the behavior of
update()
but supports asynchronous iteration. Internally, it delegates each chunk to a background thread.- Parameters:
trees (
AsyncIterable
[Tree
]) – Trees to add to the bucket.batch_size (
int
) – The number of trees to be added at once.
- Return type:
- abstractmethod close()[source]#
Close the underlying storage and release any associated resources.
- Return type:
Modules