swat.cas.table.CASTable.set_connection¶
-
CASTable.
set_connection
(self, connection)¶ Set the connection to use for action calls
When a connection is registered with a CASTable object, CAS actions can be called on it as if they were instance methods.
- Parameters
- connectionCAS object
The connection object to use.
Notes
This method creates a weak reference to the connection. If the connection is released, actions will no longer be able to be called from the CASTable object.
Examples
>>> conn = swat.CAS() >>> tbl = CASTable('my-table') >>> tbl.set_connection(conn) >>> conn is tbl.get_connection() True