@toa.io/extensions.cadence 1.0.0-alpha.317 → 1.0.0-alpha.319
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,24 +8,24 @@ import { LANES } from '@toa.io/extensions.cadence'
|
|
|
8
8
|
* row has no immediate path to settle, so nothing is gained, and an even spread is what the
|
|
9
9
|
* dispatchers want.
|
|
10
10
|
*/
|
|
11
|
-
export function transition(input,
|
|
11
|
+
export function transition(input, entry) {
|
|
12
12
|
const due = Date.now() + input.interval
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
entry.lane = Math.floor(Math.random() * LANES)
|
|
15
|
+
entry.due = due
|
|
16
|
+
entry.endpoint = input.endpoint
|
|
17
17
|
|
|
18
18
|
// absolute, because the bound is the caller's and a scan reads rows of many callers at once.
|
|
19
19
|
// No bound is the end of representable time rather than an absent field, so that one
|
|
20
20
|
// comparison answers for every row
|
|
21
|
-
|
|
21
|
+
entry.expires = input.overdue === null ? Number.MAX_SAFE_INTEGER : due + input.overdue
|
|
22
22
|
|
|
23
23
|
// a call that takes no request has none: the entity's `request` is an object where it is
|
|
24
24
|
// there at all, and a null would not fit it
|
|
25
|
-
if (input.request !== undefined)
|
|
25
|
+
if (input.request !== undefined) entry.request = input.request
|
|
26
26
|
|
|
27
27
|
// the chain that asked for the call, absent where the caller detached it
|
|
28
|
-
if (input.trail !== undefined)
|
|
28
|
+
if (input.trail !== undefined) entry.trail = input.trail
|
|
29
29
|
|
|
30
|
-
return
|
|
30
|
+
return entry.id
|
|
31
31
|
}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* `DELETED` is also what the retention index reaps by, so that the record outlives the call
|
|
7
7
|
* without outliving the deployment.
|
|
8
8
|
*/
|
|
9
|
-
export function transition(_,
|
|
9
|
+
export function transition(_, entries) {
|
|
10
10
|
const now = Date.now()
|
|
11
11
|
|
|
12
|
-
for (const
|
|
12
|
+
for (const entry of entries) entry.DELETED = now
|
|
13
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/extensions.cadence",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.319",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Toa Schedule",
|
|
6
6
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"!**/.env*"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@toa.io/core": "1.0.0-alpha.
|
|
30
|
-
"@toa.io/definitions": "1.0.0-alpha.
|
|
29
|
+
"@toa.io/core": "1.0.0-alpha.319",
|
|
30
|
+
"@toa.io/definitions": "1.0.0-alpha.319",
|
|
31
31
|
"@toa.io/generic": "1.0.0-alpha.311",
|
|
32
32
|
"@toa.io/schemas": "1.0.0-alpha.311",
|
|
33
33
|
"openspan": "1.0.0-alpha.305"
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"scripts": {
|
|
36
36
|
"transpile": "tsc"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "ee4901f2bc12c33fc2098a62f2af0c29838a2c2c"
|
|
39
39
|
}
|