Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AsyncMap<K, V>

An asynchronous map.

AsyncMap does not allow null to be used as a key or value.

Type parameters

  • K

  • V

Hierarchy

  • AsyncMap

Index

Methods

clear

  • Clear all entries in the map

    Returns PromiseLike<void>

  • Clear all entries in the map

    Parameters

    Returns void

get

  • Get a value from the map, asynchronously.

    Parameters

    • k: K

    Returns PromiseLike<V>

  • Get a value from the map, asynchronously.

    Parameters

    Returns void

keys

  • Get the keys of the map, asynchronously.

    Use this method with care as the map may contain a large number of keys, which may not fit entirely in memory of a single node. In this case, the invocation will result in an OutOfMemoryError.

    Returns PromiseLike<K>

  • Get the keys of the map, asynchronously.

    Use this method with care as the map may contain a large number of keys, which may not fit entirely in memory of a single node. In this case, the invocation will result in an OutOfMemoryError.

    Parameters

    Returns void

put

  • put(k: K, v: V): PromiseLike<void>
  • put(k: K, v: V, completionHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): void
  • put(k: K, v: V, ttl: number): PromiseLike<void>
  • put(k: K, v: V, ttl: number, completionHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): void
  • Put a value in the map, asynchronously.

    Parameters

    • k: K
    • v: V

    Returns PromiseLike<void>

  • Put a value in the map, asynchronously.

    Parameters

    Returns void

  • Like {@link AsyncMap#put} but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.

    Parameters

    • k: K
    • v: V
    • ttl: number

    Returns PromiseLike<void>

  • Like {@link AsyncMap#put} but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.

    Parameters

    Returns void

putIfAbsent

  • putIfAbsent(k: K, v: V): PromiseLike<V>
  • putIfAbsent(k: K, v: V, completionHandler: ((res: AsyncResult<V>) => void) | Handler<AsyncResult<V>>): void
  • putIfAbsent(k: K, v: V, ttl: number): PromiseLike<V>
  • putIfAbsent(k: K, v: V, ttl: number, completionHandler: ((res: AsyncResult<V>) => void) | Handler<AsyncResult<V>>): void
  • Put the entry only if there is no entry with the key already present. If key already present then the existing value will be returned to the handler, otherwise null.

    Parameters

    • k: K
    • v: V

    Returns PromiseLike<V>

  • Put the entry only if there is no entry with the key already present. If key already present then the existing value will be returned to the handler, otherwise null.

    Parameters

    Returns void

  • Link {@link AsyncMap#putIfAbsent} but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.

    Parameters

    • k: K
    • v: V
    • ttl: number

    Returns PromiseLike<V>

  • Link {@link AsyncMap#putIfAbsent} but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.

    Parameters

    Returns void

remove

  • Remove a value from the map, asynchronously.

    Parameters

    • k: K

    Returns PromiseLike<V>

  • Remove a value from the map, asynchronously.

    Parameters

    Returns void

removeIfPresent

  • removeIfPresent(k: K, v: V): PromiseLike<boolean>
  • removeIfPresent(k: K, v: V, resultHandler: ((res: AsyncResult<boolean>) => void) | Handler<AsyncResult<boolean>>): void
  • Remove a value from the map, only if entry already exists with same value.

    Parameters

    • k: K
    • v: V

    Returns PromiseLike<boolean>

  • Remove a value from the map, only if entry already exists with same value.

    Parameters

    Returns void

replace

  • replace(k: K, v: V): PromiseLike<V>
  • replace(k: K, v: V, resultHandler: ((res: AsyncResult<V>) => void) | Handler<AsyncResult<V>>): void
  • replace(k: K, v: V, ttl: number): PromiseLike<V>
  • replace(k: K, v: V, ttl: number, resultHandler: ((res: AsyncResult<V>) => void) | Handler<AsyncResult<V>>): void
  • Replace the entry only if it is currently mapped to some value

    Parameters

    • k: K
    • v: V

    Returns PromiseLike<V>

  • Replace the entry only if it is currently mapped to some value

    Parameters

    Returns void

  • Replace the entry only if it is currently mapped to some value

    Parameters

    • k: K
    • v: V
    • ttl: number

    Returns PromiseLike<V>

  • Replace the entry only if it is currently mapped to some value

    Parameters

    Returns void

replaceIfPresent

  • replaceIfPresent(k: K, oldValue: V, newValue: V): PromiseLike<boolean>
  • replaceIfPresent(k: K, oldValue: V, newValue: V, resultHandler: ((res: AsyncResult<boolean>) => void) | Handler<AsyncResult<boolean>>): void
  • replaceIfPresent(k: K, oldValue: V, newValue: V, ttl: number): PromiseLike<boolean>
  • replaceIfPresent(k: K, oldValue: V, newValue: V, ttl: number, resultHandler: ((res: AsyncResult<boolean>) => void) | Handler<AsyncResult<boolean>>): void
  • Replace the entry only if it is currently mapped to a specific value

    Parameters

    • k: K
    • oldValue: V
    • newValue: V

    Returns PromiseLike<boolean>

  • Replace the entry only if it is currently mapped to a specific value

    Parameters

    Returns void

  • Replace the entry only if it is currently mapped to a specific value

    Parameters

    • k: K
    • oldValue: V
    • newValue: V
    • ttl: number

    Returns PromiseLike<boolean>

  • Replace the entry only if it is currently mapped to a specific value

    Parameters

    Returns void

size

  • Provide the number of entries in the map

    Returns PromiseLike<number>

  • Provide the number of entries in the map

    Parameters

    Returns void

values

  • Get the values of the map, asynchronously.

    Use this method with care as the map may contain a large number of values, which may not fit entirely in memory of a single node. In this case, the invocation will result in an OutOfMemoryError.

    Returns PromiseLike<V>

  • Get the values of the map, asynchronously.

    Use this method with care as the map may contain a large number of values, which may not fit entirely in memory of a single node. In this case, the invocation will result in an OutOfMemoryError.

    Parameters

    Returns void

Generated using TypeDoc