Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface LockableKeyValueStorage

Hierarchy

Index

Properties

length

length: Number

Gets the number of key/value pairs currently present in the storage object.

Methods

clear

  • clear(): void

getItem

  • getItem(key: String): any

lock

  • lock(): void
  • Locks the storage object or waits until it can be locked. When a thread calls this method, it becomes the only thread able to read or modify the storage object until it unlocks it. This is a blocking method. See tryLock() method for a non blocking method.

    Returns void

removeItem

  • removeItem(key: String): void

setItem

  • setItem(key: String, value: String | Number | Object): void

tryLock

  • tryLock(): Boolean
  • Tries to lock the storage object. Returns true in case of success and false otherwise. This is a non blocking method. See lock() method for a blocking method.

    Returns Boolean

unlock

  • unlock(): void
  • Removes a lock that was previously put on the storage object.

    Returns void