IUnlockNotifyHandler

UnlockNotifyHandler interface to be used for custom implementations of UnlockNotify pattern with SQLite.

Note: For the C API sqlite3_unlock_notify to be used, this library must be compiled with -version=SqliteEnableUnlockNotify. Otherwise only emulated solution is provided, that is based on retries for the defined amount of time.

Implementation must be able to handle situation when emit is called sooner than the wait itself.

Members

Functions

emit
void emit(int state)

Unlocks the handler. This is called from registered callback from SQLite.

reset
void reset()

Resets the handler for the next use

wait
void wait()

Blocks until emit is called

waitOne
void waitOne()

This is used as an alternative when SQLite is not compiled with SQLITE_ENABLE_UNLOCK_NOTIFY, and when the library is built with -version=SqliteFakeUnlockNotify. Using this, the handler tries to wait out the SQLITE_LOCKED state for some time. Implementation have to block for some amount of time and check if total amount is not greater than some constant afterwards. If there is still some time to try again, the handler must set the result to SQLITE_OK or to SQLITE_LOCKED otherwise.

Properties

result
int result [@property getter]

Result after wait is finished

See Also

Meta