An asynchronous map.

no subtypes hierarchy

Initializer
AsyncMap(AsyncMap<out Object,out Object> unknown)
Inherited Attributes
Attributes inherited from: Object
hash, string
Methods
clearshared default void clear(Anything(Throwable?) resultHandler)

Clear all entries in the map

Parameters:
  • resultHandler

    called on completion

getshared default void get(K k, Anything(Throwable|V) resultHandler)

Get a value from the map, asynchronously.

Parameters:
  • k

    the key

  • resultHandler
    • this will be called some time later with the async result.
putshared default void put(K k, V v, Anything(Throwable?) completionHandler)

Put a value in the map, asynchronously.

Parameters:
  • k

    the key

  • v

    the value

  • completionHandler
    • this will be called some time later to signify the value has been put
putshared default void put(K k, V v, Integer ttl, Anything(Throwable?) completionHandler)

Like put but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.

Parameters:
  • k

    the key

  • v

    the value

  • ttl

    The time to live (in ms) for the entry

  • completionHandler

    the handler

putIfAbsentshared default void putIfAbsent(K k, V v, Anything(Throwable|V) completionHandler)

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

    the key

  • v

    the value

  • completionHandler

    the handler

putIfAbsentshared default void putIfAbsent(K k, V v, Integer ttl, Anything(Throwable|V) completionHandler)

Link putIfAbsent but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.

Parameters:
  • k

    the key

  • v

    the value

  • ttl

    The time to live (in ms) for the entry

  • completionHandler

    the handler

removeshared default void remove(K k, Anything(Throwable|V) resultHandler)

Remove a value from the map, asynchronously.

Parameters:
  • k

    the key

  • resultHandler
    • this will be called some time later to signify the value has been removed
removeIfPresentshared default void removeIfPresent(K k, V v, Anything(Throwable|Boolean) resultHandler)

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

Parameters:
  • k

    the key

  • v

    the value

  • resultHandler
    • this will be called some time later to signify the value has been removed
replaceshared default void replace(K k, V v, Anything(Throwable|V) resultHandler)

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

Parameters:
  • k

    the key

  • v

    the new value

  • resultHandler

    the result handler will be passed the previous value

replaceIfPresentshared default void replaceIfPresent(K k, V oldValue, V newValue, Anything(Throwable|Boolean) resultHandler)

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

Parameters:
  • k

    the key

  • oldValue

    the existing value

  • newValue

    the new value

  • resultHandler

    the result handler

sizeshared default void size(Anything(Throwable|Integer) resultHandler)

Provide the number of entries in the map

Parameters:
  • resultHandler

    handler which will receive the number of entries

Inherited Methods
Methods inherited from: Object
equals