annotations-design-patterns
Guías (ES)
Guides (EN)
Preparing search index...
experimental
VersionedAsyncStore
Interface VersionedAsyncStore<Value>
Minimal async compare-and-set contract. Versions are opaque to callers.
interface
VersionedAsyncStore
<
Value
>
{
capabilities
:
{
compareExchange
:
true
;
ttl
:
true
}
;
read
(
key
:
string
)
:
Promise
<
VersionedStoreEntry
<
Value
>
>
;
compareExchange
(
key
:
string
,
expectedVersion
:
string
,
value
:
Value
,
ttlMs
?:
number
,
)
:
Promise
<
VersionedCompareExchangeResult
<
Value
>
>
;
deleteIfVersion
(
key
:
string
,
expectedVersion
:
string
)
:
Promise
<
boolean
>
;
}
Type Parameters
Value
Implemented by
VersionedMemoryStore
Index
Properties
capabilities
Methods
read
compare
Exchange
delete
If
Version
Properties
Readonly
capabilities
capabilities
:
{
compareExchange
:
true
;
ttl
:
true
}
Methods
read
read
(
key
:
string
)
:
Promise
<
VersionedStoreEntry
<
Value
>
>
Parameters
key
:
string
Returns
Promise
<
VersionedStoreEntry
<
Value
>
>
compare
Exchange
compareExchange
(
key
:
string
,
expectedVersion
:
string
,
value
:
Value
,
ttlMs
?:
number
,
)
:
Promise
<
VersionedCompareExchangeResult
<
Value
>
>
Parameters
key
:
string
expectedVersion
:
string
value
:
Value
Optional
ttlMs
:
number
Returns
Promise
<
VersionedCompareExchangeResult
<
Value
>
>
delete
If
Version
deleteIfVersion
(
key
:
string
,
expectedVersion
:
string
)
:
Promise
<
boolean
>
Parameters
key
:
string
expectedVersion
:
string
Returns
Promise
<
boolean
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Properties
capabilities
Methods
read
compare
Exchange
delete
If
Version
Guías (ES)
Guides (EN)
annotations-design-patterns
Loading...
Minimal async compare-and-set contract. Versions are opaque to callers.