Class s.p.PersistentArray(object):

Part of sasync.parray View In Hierarchy

I am a three-dimensional array of Python objects, addressable by any three-way combination of hashable Python objects. You can use me as a two-dimensional array by simply using some constant, e.g., None when supplying an address for my third dimension.

IMPORTANT: Make sure you call my shutdown method for an instance of me that you're done with before allowing that instance to be deleted.
Method __init__ Constructor, with a URL and any engine-specifying keywords supplied if
Method shutdown Shuts down my database Transactor and its synchronous task queue.
Method write Performs a database write transaction, returning a deferred to its
Method get Retrieves an element (x,y,z) from the database.
Method set Persists the supplied value of element (x,y,z) to the database,
Method delete Deletes the database row for element (x,y,z).
Method clear Deletes the entire group of database rows for all of my elements
def __init__(self, ID, *url, **kw):
Constructor, with a URL and any engine-specifying keywords supplied if a particular engine is to be used for this instance. The following additional keyword is particular to this constructor:
Unknown Field: keywordsearchSet True if text indexing is to be performed on items as they are written.
def shutdown(self, *null):
Shuts down my database Transactor and its synchronous task queue.
def write(self, funcName, *args, **kw):

Performs a database write transaction, returning a deferred to its completion.

If we are updating the search index, there's a nuance to the deferred processing. In that case, when the write is done, the deferred is fired and processing separately proceeds with indexing of the written value. Here's how it works:
  1. Create a clean deferred d1 to return to the caller, whose callback(s) will be fired from the callback to the transaction's own deferred d2.
  2. Start the write transaction and assign the writeDone function as the callback to its deferred d2. Note that the defer-to-queue transaction keeps a reference to the deferred object it instantiates, so we don't have to do so for either d2 or d3. Those references are merely defined in the method for code readability.
def get(self, x, y, z):
Retrieves an element (x,y,z) from the database.
def set(self, x, y, z, value):
Persists the supplied value of element (x,y,z) to the database, inserting or updating a row as appropriate.
def delete(self, x, y, z):
Deletes the database row for element (x,y,z).
def clear(self):
Deletes the entire group of database rows for all of my elements (Use with care!)
API Documentation for sAsync, generated by pydoctor.