Commit 8795b1c
committed
Make
The public API is now:
* `khepri_payload:none/0`
* `khepri_payload:data/1`
* `khepri_payload:sproc/1`
That said, the caller should rarely have to use them: `khepri:put/1`
tries to automatically detect if and how to wrap the given value.
Therefore, one should be able to just use:
khepri:put(StoreId, Path, #my_record{...}).
Or:
khepri:put(StoreId, Path, fun() -> ... end).
Only the "no payload" case has no value beside the internal one. In this
case, the caller should use:
khepri:put(StoreId, Path, khepri_payload:none()).
Or:
khepri:clear_payload(StoreId, Path).
The end goal is to reduce the chance that if we change the payload
records, users are forced to recompile their code. It also makes the
code maintenance easier for us.
Note that in the process, the records are renamed `#p_*{}`.#kpayload_*{} records private1 parent 7e8ed85 commit 8795b1c
File tree
22 files changed
+500
-490
lines changed- doc
- include
- src
- test
22 files changed
+500
-490
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
147 | | - | |
148 | | - | |
| 146 | + | |
149 | 147 | | |
150 | 148 | | |
151 | 149 | | |
| |||
174 | 172 | | |
175 | 173 | | |
176 | 174 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
| 175 | + | |
181 | 176 | | |
182 | 177 | | |
183 | 178 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
93 | 95 | | |
94 | | - | |
95 | | - | |
96 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
97 | 99 | | |
98 | 100 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | 101 | | |
107 | 102 | | |
108 | 103 | | |
| |||
343 | 338 | | |
344 | 339 | | |
345 | 340 | | |
346 | | - | |
347 | | - | |
| 341 | + | |
348 | 342 | | |
349 | 343 | | |
350 | 344 | | |
| |||
375 | 369 | | |
376 | 370 | | |
377 | 371 | | |
378 | | - | |
379 | | - | |
| 372 | + | |
380 | 373 | | |
381 | 374 | | |
382 | | - | |
| 375 | + | |
383 | 376 | | |
384 | 377 | | |
385 | | - | |
| 378 | + | |
386 | 379 | | |
387 | 380 | | |
388 | 381 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | 36 | | |
49 | 37 | | |
50 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
19 | 27 | | |
20 | 28 | | |
21 | 29 | | |
22 | | - | |
| 30 | + | |
23 | 31 | | |
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
27 | 35 | | |
28 | | - | |
| 36 | + | |
29 | 37 | | |
30 | 38 | | |
31 | 39 | | |
| |||
0 commit comments