Class: AsyncMap

vertx-js/async_map~ AsyncMap

new AsyncMap()

An asynchronous map.

Source:

Methods

clear(resultHandler)

Clear all entries in the map
Parameters:
Name Type Description
resultHandler function called on completion
Source:

get(k, resultHandler)

Get a value from the map, asynchronously.
Parameters:
Name Type Description
k Object the key
resultHandler function this will be called some time later with the async result.
Source:

put(k, v, ttl, completionHandler)

Like AsyncMap#put but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.
Parameters:
Name Type Description
k Object the key
v Object the value
ttl number The time to live (in ms) for the entry
completionHandler function the handler
Source:

putIfAbsent(k, v, ttl, completionHandler)

Link AsyncMap#putIfAbsent but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.
Parameters:
Name Type Description
k Object the key
v Object the value
ttl number The time to live (in ms) for the entry
completionHandler function the handler
Source:

remove(k, resultHandler)

Remove a value from the map, asynchronously.
Parameters:
Name Type Description
k Object the key
resultHandler function this will be called some time later to signify the value has been removed
Source:

removeIfPresent(k, v, resultHandler)

Remove a value from the map, only if entry already exists with same value.
Parameters:
Name Type Description
k Object the key
v Object the value
resultHandler function this will be called some time later to signify the value has been removed
Source:

replace(k, v, resultHandler)

Replace the entry only if it is currently mapped to some value
Parameters:
Name Type Description
k Object the key
v Object the new value
resultHandler function the result handler will be passed the previous value
Source:

replaceIfPresent(k, oldValue, newValue, resultHandler)

Replace the entry only if it is currently mapped to a specific value
Parameters:
Name Type Description
k Object the key
oldValue Object the existing value
newValue Object the new value
resultHandler function the result handler
Source:

size(resultHandler)

Provide the number of entries in the map
Parameters:
Name Type Description
resultHandler function handler which will receive the number of entries
Source: