/
MemoryStoreSortedMap.yaml
209 lines (205 loc) · 6.81 KB
/
MemoryStoreSortedMap.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
name: MemoryStoreSortedMap
type: class
category:
memory_category: Instances
summary: |
Provides access to a sorted map within MemoryStore.
description: |
Provides access to a sorted map within MemoryStore. A sorted map is a
collection of items where string keys are associated with arbitrary values (up
to the maximum allowed size -- see
[Memory Stores](../../../cloud-services/memory-stores/sorted-map.md)). Each
item can also have an optional sort key, which can be a number or a string. In
the ordering of items, the sort key, if provided, takes precedence over the
key. Items with numeric sort keys are sorted before items with string sort
keys, which are sorted before items with no sort key. Items with the same sort
key and items with no sort key are arranged in alphabetical order by key.
code_samples:
inherits:
- Instance
tags:
- NotCreatable
- NotReplicated
deprecation_message: ''
properties: []
methods:
- name: MemoryStoreSortedMap:GetAsync
summary: |
Retrieves the value and sort key of a key in the sorted map.
description: |
Retrieves the value and sort key of a key in the sorted map.
code_samples:
parameters:
- name: key
type: string
default:
summary: |
Key whose value and sort key to retrieve.
returns:
- type: Tuple
summary: |
A tuple of two values:
- Key value, or nil -- if there's no item with the specified key.
- Sort key, or nil -- if there's no sort key associated with the
specified key.
tags:
- Yields
deprecation_message: ''
security: None
thread_safety: Unsafe
- name: MemoryStoreSortedMap:GetRangeAsync
summary: |
Retrieves items within a sorted range of keys and sort keys.
description: |
Gets items within a sorted range of keys and sort keys.
code_samples:
- retrieving-memorystore-keys
parameters:
- name: direction
type: SortDirection
default:
summary: |
Sort direction, ascending or descending.
- name: count
type: int
default:
summary: |
The number of items to retrieve; the maximum allowed value for this
parameter is 200.
- name: exclusiveLowerBound
type: Variant
default:
summary: |
**(Optional)** Lower bound, exclusive, for the returned keys. This is
provided as a table where one or both of key and sort key can be
specified: { key: string, sortKey: Variant } .
- name: exclusiveUpperBound
type: Variant
default:
summary: |
**(Optional)** Upper bound, exclusive, for the returned keys. This is
provided as a table where one or both of key and sort key can be
specified: { key: string, sortKey: Variant } .
returns:
- type: Array
summary: |
Item keys, values and sort keys in the requested range.
tags:
- Yields
deprecation_message: ''
security: None
thread_safety: Unsafe
- name: MemoryStoreSortedMap:RemoveAsync
summary: |
Removes the provided key from the sorted map.
description: |
Removes the provided key from the sorted map.
code_samples:
parameters:
- name: key
type: string
default:
summary: |
Key to remove.
returns:
- type: void
summary: ''
tags:
- Yields
deprecation_message: ''
security: None
thread_safety: Unsafe
- name: MemoryStoreSortedMap:SetAsync
summary: |
Sets the value of a key.
description: |
Sets the value and sort key of the key overwriting any existing key value
and sort key.
code_samples:
parameters:
- name: key
type: string
default:
summary: |
Key whose value to set.
- name: value
type: Variant
default:
summary: |
Key value to set.
- name: expiration
type: int64
default:
summary: |
Item expiration, in seconds. The item is automatically removed from
the sorted map once the expiration duration is reached. The maximum
expiration time is 45 days (3,888,000 seconds).
- name: sortKey
type: Variant
default:
summary: |
**(Optional)** Sort key to set for this key. Accepted types are a
number (integer or decimal) or a string.
returns:
- type: bool
summary: ''
tags:
- Yields
deprecation_message: ''
security: None
thread_safety: Unsafe
- name: MemoryStoreSortedMap:UpdateAsync
summary: |
Retrieves the value and sort key of a key from a sorted map and updates it
with a new value and sort key.
description: |
Retrieves the value and sort key of a key from a sorted map and lets you
update it to a new value and sort key via a callback function.
This method accepts a callback function that transforms the old value and
old sort key into the updated value and updated sort key as required. The
method retrieves the existing key value and sort key and passes it to the
transform function which returns the new value and sort key for the item,
with these exceptions:
- If the key does not exist, the old value and old sort key passed to the
function will be nil.
- If the function returns nil, the update is canceled.
The new value and new sort key is saved only if the key was not updated
(e.g. by a different game server) since the moment it was read. If the
value or sort key did change, the transform function is invoked again with
the most recent item value and sort key. This cycle repeats until the
value and sort key are saved successfully or the transform function
returns nil to abort the operation.
code_samples:
- updating-a-memorystore
parameters:
- name: key
type: string
default:
summary: |
Key whose value to update.
- name: transformFunction
type: Function
default:
summary: |
A function which you need to provide. The function takes the key's old
value and old sort key as input and returns the new value and new sort
key.
- name: expiration
type: int64
default:
summary: |
Item expiration time, in seconds, after which the item will be
automatically removed from the sorted map. The maximum expiration time
is 45 days (3,888,000 seconds).
returns:
- type: Tuple
summary: |
The return value is a tuple of the last value and sort key returned by
the transform function.
tags:
- Yields
deprecation_message: ''
security: None
thread_safety: Unsafe
events: []
callbacks: []