UnlockNotifyHandler

UnlockNotifyHandler used when SQLite is compiled with SQLITE_ENABLE_UNLOCK_NOTIFY, and when the library is built with -version=SqliteEnableUnlockNotify. It is implemented using the standard core.sync package.

Use setUnlockNotifyHandler method to handle the database lock.

  1. class UnlockNotifyHandler
    version(SqliteEnableUnlockNotify)final
    class UnlockNotifyHandler : IUnlockNotifyHandler {}
  2. class UnlockNotifyHandler

Constructors

this
this()

Constructor

Members

Functions

emit
void emit(int res)

Unlocks the handler, state is one of SQLITE_LOCKED or SQLITE_OK

reset
void reset()

Resets the handler for the next use

wait
void wait()

Blocks until emit is called

Properties

result
int result [@property getter]

Result after wait is finished

Inherited Members

From IUnlockNotifyHandler

wait
void wait()

Blocks until emit is called

emit
void emit(int state)

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

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.

reset
void reset()

Resets the handler for the next use

result
int result [@property getter]

Result after wait is finished

See Also

Meta