tibasPersister_Create()

Creates a Persister object that can be registered on a space. The arguments of this call are used to specify the names of functions that will be invoked at various points in the life cycle of a space.

Declaration

tibas_status tibasPersister_Create  
   (tibasPersister *persister,
   tibas_onAction onOpen,
   tibas_onAction onLoad,
   tibas_onAction onWrite,
   tibas_onAction onClose,
   tibas_onAction onRead,
   tibas_onAction onAlter,
			void* closure)

Parameters

Parameter Description
persister The Persister object created by the operation.
onOpen Specifies the function to be invoked when the Persister is registered.
onLoad Specifies the function to be invoked when the space is in its load state.
onWrite Specifies the function to be invoked when the space is in its ready state.
onRead Specifies function to be invoked when the space is in its ready state.
onClose Specifies the function to be invoked when the members leave the Metaspace or tibasSpace_StopPersister is invoked.
onAlter Specifies the function to be invoked when the space definition is altered.
closure Is a pointer to the closure data that will be passed to the callback function when the persister is invoked. Pass NULL if you do not want to pass the closure data to the call back function.

Remarks

If you are implementing shared all persistence, use the tibasPersister_Create() function to create a Persister object that you can use to persist application data.

The persister object that you create specifies functions that will be called at various points in the life cycle of the space; for example, when the space is in the READY state to read data from local storage, or when a member leaves the space, to write data to local storage.

After you are have created the persister object, use the tibasSpace_SetPersister() function to register the persister for a specified space.

Before you can call tibasSpace_SetPersister(), you must create a persister object by calling the tibasPersister_Create() function.

The name that you assign with the persister parameter specifies the name of a function that your application provides to call the functions that are called at specified points in the life cycle of the space, to implement persistence.