[[user-comments:osrf-devel:persist-slot|User Comments]] **General Persistence Slot methods** Methods used to create, use and destroy slots. ===== opensrf.persist.slot.create( slot_name ) ===== Creates a Persistence Slot. * **Parameters:** * //slot_name (optional)//\\ The name of the Persistence Slot to create. If a name is not specified then the Slot is given a generic, unique name. Automatically named Slots are destroyed as soon as they are empty. * **Returns:** * //Success//\\ The name of the Slot that was created. * //Failure//\\ An empty (NULL) result. ===== opensrf.persist.slot.create_expirable( slot_name, expire_interval ) ===== Creates a Persistence Slot that is automatically destroyed after the specified interval. * **Parameters:** * //slot_name//\\ The name of the Persistence Slot to create. * //expire_interval//\\ An interval describing how long to wait after an access has occured on the Slot before automatically destroying it. The interval can be specified using a descriptive, human readable format, or as a number of seconds, and a setting of 0 (zero) disables automatic expiration for a Slot. For example:\\ * 1 day, 2 hours and 35 minutes * +2h * 1 week * 300 * **Returns:** * //Success//\\ The name of the Slot that was created. * //Failure//\\ An empty (NULL) result. ===== opensrf.persist.slot.set_expire( slot_name, expire_interval ) ===== Sets or disables the expiration interval on an existing Persistence Slot. * **Parameters:** * //slot_name//\\ The name of the Persistence Slot to update. * //expire_interval//\\ An interval describing how long to wait after an access has occured on the Slot before automatically destroying it. The interval can be specified using a fairly complex, human readable format, or as a number of seconds, and a setting of 0 (zero) disables automatic expiration for a Slot. For example:\\ * 1 day, 2 hours and 35 minutes * +2h * 1 week * 300 * **Returns:** * //Success//\\ The number of seconds the requested interval represents. * //Failure//\\ An empty (NULL) result. ===== opensrf.persist.slot.destroy( slot_name ) ===== Destroys a Persistence Slot. * **Parameters:** * //slot_name//\\ The name of the Persistence Slot to destroy. * **Returns:** * //Success//\\ The name of the Slot that was destroyed. * //Failure//\\ An empty (NULL) result.