Upload queue for nodes¶
-
class
larch.uploadqueue.UploadQueue(really_put, max_length)¶ Queue of objects waiting to be uploaded to the store.
We don’t upload nodes directly, because it frequently happens that a node gets modified or deleted soon after it is created. It makes sense to wait a bit so we can avoid the costly upload operation.
This class holds the nodes in a queue, and uploads them if they get pushed out of the queue.
really_putis the function to call to really upload a node.max_lengthis the maximum number of nodes to keep in the queue.-
get(node_id)¶ Get a node node given its id.
-
list_ids()¶ List identifiers of all nodes in the queue.
-
push()¶ Upload all nodes in the queue.
-
put(node)¶ Put a node into the queue.
-
remove(node_id)¶ Remove a node from the queue given its id.
-