solid-objects 1.0.6 → 1.1.0
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.
- package/CHANGELOG.md +36 -1
- package/README.md +4 -1
- package/dist/actor.d.ts +2 -2
- package/dist/actor.d.ts.map +1 -1
- package/dist/actor.js +10 -4
- package/dist/actor.js.map +1 -1
- package/dist/broadcast-worker.d.ts +1 -0
- package/dist/broadcast-worker.d.ts.map +1 -1
- package/dist/broadcast-worker.js +10 -1
- package/dist/broadcast-worker.js.map +1 -1
- package/dist/cloudflare/engine.d.ts +1 -0
- package/dist/cloudflare/engine.d.ts.map +1 -1
- package/dist/cloudflare/engine.js +36 -9
- package/dist/cloudflare/engine.js.map +1 -1
- package/dist/cloudflare/records.d.ts +5 -1
- package/dist/cloudflare/records.d.ts.map +1 -1
- package/dist/cloudflare/records.js +8 -1
- package/dist/cloudflare/records.js.map +1 -1
- package/dist/configuration.d.ts +2 -0
- package/dist/configuration.d.ts.map +1 -1
- package/dist/configuration.js +24 -1
- package/dist/configuration.js.map +1 -1
- package/dist/doctor.js +1 -1
- package/dist/doctor.js.map +1 -1
- package/dist/due-work.d.ts +15 -0
- package/dist/due-work.d.ts.map +1 -0
- package/dist/due-work.js +124 -0
- package/dist/due-work.js.map +1 -0
- package/dist/effect-worker.d.ts +1 -0
- package/dist/effect-worker.d.ts.map +1 -1
- package/dist/effect-worker.js +10 -1
- package/dist/effect-worker.js.map +1 -1
- package/dist/errors.d.ts +14 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +11 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/local-signal.d.ts +15 -0
- package/dist/local-signal.d.ts.map +1 -0
- package/dist/local-signal.js +35 -0
- package/dist/local-signal.js.map +1 -0
- package/dist/records.d.ts +2 -1
- package/dist/records.d.ts.map +1 -1
- package/dist/redrive.d.ts +3 -0
- package/dist/redrive.d.ts.map +1 -1
- package/dist/redrive.js +30 -1
- package/dist/redrive.js.map +1 -1
- package/dist/reminder-administration.d.ts +1 -1
- package/dist/reminder-administration.d.ts.map +1 -1
- package/dist/reminder-scheduler.d.ts +1 -0
- package/dist/reminder-scheduler.d.ts.map +1 -1
- package/dist/reminder-scheduler.js +10 -1
- package/dist/reminder-scheduler.js.map +1 -1
- package/dist/repository.d.ts +9 -1
- package/dist/repository.d.ts.map +1 -1
- package/dist/repository.js +83 -30
- package/dist/repository.js.map +1 -1
- package/dist/runtime.d.ts +6 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +64 -12
- package/dist/runtime.js.map +1 -1
- package/dist/schema.d.ts +1 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +132 -2
- package/dist/schema.js.map +1 -1
- package/dist/single-owner.d.ts +17 -0
- package/dist/single-owner.d.ts.map +1 -0
- package/dist/single-owner.js +27 -0
- package/dist/single-owner.js.map +1 -0
- package/dist/types.d.ts +4 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wake-up-selection.d.ts +1 -0
- package/dist/wake-up-selection.d.ts.map +1 -1
- package/dist/wake-up-selection.js +10 -0
- package/dist/wake-up-selection.js.map +1 -1
- package/dist/wall-clock-watch.d.ts +14 -0
- package/dist/wall-clock-watch.d.ts.map +1 -0
- package/dist/wall-clock-watch.js +35 -0
- package/dist/wall-clock-watch.js.map +1 -0
- package/dist/worker.d.ts +3 -0
- package/dist/worker.d.ts.map +1 -1
- package/dist/worker.js +29 -4
- package/dist/worker.js.map +1 -1
- package/docs/agents.md +10 -0
- package/docs/api.md +30 -8
- package/docs/benchmarks-history.md +326 -0
- package/docs/benchmarks.md +197 -313
- package/docs/configuration.md +92 -15
- package/docs/correctness.md +54 -3
- package/docs/errors-and-recovery.md +4 -0
- package/docs/operations.md +45 -5
- package/docs/releasing.md +27 -0
- package/package.json +4 -3
package/docs/configuration.md
CHANGED
|
@@ -65,19 +65,20 @@ as an instruction to divide the actor. See
|
|
|
65
65
|
|
|
66
66
|
## Runtime roles and supervision
|
|
67
67
|
|
|
68
|
-
| Option | Default | Contract
|
|
69
|
-
| ------------------------------------------- | --------------: |
|
|
70
|
-
| `workerCount` | `1` | Non-negative actor workers.
|
|
71
|
-
| `effectWorkerCount` | `1` | Non-negative effect workers.
|
|
72
|
-
| `broadcastWorkerCount` | `1` | Non-negative broadcast workers when realtime is enabled.
|
|
73
|
-
| `reminderSchedulerCount` | `1` | Non-negative reminder schedulers.
|
|
74
|
-
| `processHeartbeatIntervalMilliseconds` | `15_000` | Positive persisted heartbeat cadence.
|
|
75
|
-
| `processAliveThresholdMilliseconds` | `60_000` | Positive age after which an owner is stale.
|
|
76
|
-
| `shutdownTimeoutMilliseconds` | `15_000` | Positive shared graceful-shutdown budget.
|
|
77
|
-
| `supervisorRestartDelayMilliseconds` | `100` | Positive initial failed-role replacement delay.
|
|
78
|
-
| `supervisorMaximumRestartDelayMilliseconds` | `10_000` | Positive cap no smaller than the initial delay.
|
|
79
|
-
| `wakeUp` | `"automatic"` | A name or an adapter implementing `watch`, `notify`, and `close`.
|
|
80
|
-
| `
|
|
68
|
+
| Option | Default | Contract |
|
|
69
|
+
| ------------------------------------------- | --------------: | ------------------------------------------------------------------- |
|
|
70
|
+
| `workerCount` | `1` | Non-negative actor workers. |
|
|
71
|
+
| `effectWorkerCount` | `1` | Non-negative effect workers. |
|
|
72
|
+
| `broadcastWorkerCount` | `1` | Non-negative broadcast workers when realtime is enabled. |
|
|
73
|
+
| `reminderSchedulerCount` | `1` | Non-negative reminder schedulers. |
|
|
74
|
+
| `processHeartbeatIntervalMilliseconds` | `15_000` | Positive persisted heartbeat cadence. |
|
|
75
|
+
| `processAliveThresholdMilliseconds` | `60_000` | Positive age after which an owner is stale. |
|
|
76
|
+
| `shutdownTimeoutMilliseconds` | `15_000` | Positive shared graceful-shutdown budget. |
|
|
77
|
+
| `supervisorRestartDelayMilliseconds` | `100` | Positive initial failed-role replacement delay. |
|
|
78
|
+
| `supervisorMaximumRestartDelayMilliseconds` | `10_000` | Positive cap no smaller than the initial delay. |
|
|
79
|
+
| `wakeUp` | `"automatic"` | A name or an adapter implementing `watch`, `notify`, and `close`. |
|
|
80
|
+
| `singleOwner` | `false` | `true` when this process is the only writer of its SQLite database. |
|
|
81
|
+
| `logger` | console methods | Structured `debug`, `info`, `warn`, and `error` sink. |
|
|
81
82
|
|
|
82
83
|
Counts may be zero, but the complete configuration must leave at least one
|
|
83
84
|
runtime role enabled. Broadcast workers are started only when `broadcast` or
|
|
@@ -90,7 +91,9 @@ Consecutive empty passes double it up to
|
|
|
90
91
|
fixed cadence. A custom wake-up adapter must return `true` for a notification
|
|
91
92
|
and `false` for a timeout. An older adapter that returns `void` remains
|
|
92
93
|
compatible and keeps the fast cadence. Wake-ups reduce latency, while database
|
|
93
|
-
polling remains the correctness path.
|
|
94
|
+
polling remains the correctness path. The one exception is
|
|
95
|
+
[`singleOwner`](#single-owner), which replaces polling with wake-ups and due
|
|
96
|
+
times.
|
|
94
97
|
|
|
95
98
|
Busy SQL workers and testing drains give the event loop a turn between passes.
|
|
96
99
|
In Node this lets timers and input run even with synchronous SQLite calls.
|
|
@@ -98,6 +101,79 @@ An instrumentation callback can abort `runtime.run()` before its next pass.
|
|
|
98
101
|
This does not interrupt a synchronous handler: responsiveness is bounded by
|
|
99
102
|
one pass, or by a single overlong handler that must return first.
|
|
100
103
|
|
|
104
|
+
## Single owner
|
|
105
|
+
|
|
106
|
+
Set `singleOwner: true` when one process is the only writer of its SQLite
|
|
107
|
+
database, for example a daemon that embeds the runtime and holds its database
|
|
108
|
+
file. With the option, an idle runtime sends no query. The default is `false`,
|
|
109
|
+
and the default behavior does not change.
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
const runtime = createRuntime({
|
|
113
|
+
database: sqlite({ path: "app.sqlite" }),
|
|
114
|
+
singleOwner: true,
|
|
115
|
+
})
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
With `singleOwner: true`, the runtime changes these behaviors:
|
|
119
|
+
|
|
120
|
+
- Each role waits for an in-process wake-up or for the next due time that the
|
|
121
|
+
database reports. A due time is, for example, the time of the next ready
|
|
122
|
+
message, effect, broadcast, reminder, or retry, the end of a lease, or the
|
|
123
|
+
time when the owner of a claim becomes stale. A role with nothing due waits
|
|
124
|
+
up to 24 hours and then reads its due time again.
|
|
125
|
+
- A write in this process that adds work or moves it earlier wakes the roles
|
|
126
|
+
that must react. A role that waits for a later due time then reads the new
|
|
127
|
+
due time.
|
|
128
|
+
- The actor worker renews a lease only while it holds a cached activation.
|
|
129
|
+
When idle deactivation releases the last activation, the worker stops waking
|
|
130
|
+
for leases.
|
|
131
|
+
- Each role writes its process row once at start and once at shutdown. A claim
|
|
132
|
+
also writes the row of the worker that claims, in the claim transaction, so
|
|
133
|
+
that running work always has a fresh owner. An empty pass writes nothing.
|
|
134
|
+
- No periodic dead-process cleanup runs, and
|
|
135
|
+
`deadProcessCleanupIntervalMilliseconds` has no effect. `run()` releases
|
|
136
|
+
stale process rows once, at start.
|
|
137
|
+
- A watch compares the wall clock with the process clock every 10 seconds.
|
|
138
|
+
Node timers stop while the computer sleeps, so after a sleep, or after a jump
|
|
139
|
+
of one second or more, every role reads its due time again. The watch sends
|
|
140
|
+
no query.
|
|
141
|
+
- When a due time is now or has passed and a claim still finds nothing, the
|
|
142
|
+
role tries again after 1 ms. A timer can end a few milliseconds before the
|
|
143
|
+
database clock reaches the due time, and this retry takes the work at once.
|
|
144
|
+
Each further retry doubles the wait, up to the polling interval, so stuck
|
|
145
|
+
work cannot spin. `pollingIntervalMilliseconds` and
|
|
146
|
+
`idlePollingIntervalMilliseconds` set only this limit.
|
|
147
|
+
|
|
148
|
+
Work that is active runs as before. A turn renews its lease, and an effect or a
|
|
149
|
+
broadcast sends its process heartbeat while it runs. Automatic retention still
|
|
150
|
+
runs at start and every `retentionIntervalMilliseconds`. Set that interval to
|
|
151
|
+
`0` to stop it, and prune with `runtime.retention.prune()` instead.
|
|
152
|
+
|
|
153
|
+
`run()` refuses to start with `SingleOwnerConflict` when another process row is
|
|
154
|
+
alive by the usual rule: the row is not stopped, and its heartbeat is newer
|
|
155
|
+
than `processAliveThresholdMilliseconds`. The error names each row and the time
|
|
156
|
+
at which the row becomes stale. The rows of the runtime's own synchronous
|
|
157
|
+
callers do not count.
|
|
158
|
+
|
|
159
|
+
`createRuntime()` refuses the option in these cases:
|
|
160
|
+
|
|
161
|
+
- The database is not SQLite. PostgreSQL and MySQL are servers that other
|
|
162
|
+
processes can reach. The runtime cannot know that it is the only writer, and
|
|
163
|
+
without polling a write from another process can wait up to 24 hours.
|
|
164
|
+
- `wakeUp` is `"postgresql"`, `"redis"`, or an adapter. A notification over a
|
|
165
|
+
connection can be lost when the connection fails, and the runtime cannot
|
|
166
|
+
prove that a custom adapter delivers every signal. Without polling, a lost
|
|
167
|
+
signal can delay work for up to 24 hours. With `"automatic"` or
|
|
168
|
+
`"in_process"`, the runtime uses in-process signalling and ignores
|
|
169
|
+
`SOLID_OBJECTS_REDIS_URL`.
|
|
170
|
+
|
|
171
|
+
Do not use the option with `sharedSqliteWasm`, because each tab runs its own
|
|
172
|
+
runtime against the shared database. See
|
|
173
|
+
[Correctness and delivery semantics](correctness.md#single-owner) for the
|
|
174
|
+
guarantee and its limits, and [Operations](operations.md#single-owner) for
|
|
175
|
+
monitoring.
|
|
176
|
+
|
|
101
177
|
## Retention and cleanup
|
|
102
178
|
|
|
103
179
|
| Option | Default | Contract |
|
|
@@ -206,7 +282,8 @@ the files only when no process has the database open. An in-memory database
|
|
|
206
282
|
|
|
207
283
|
`wakeUp` takes a name or an adapter, as `config.cache_store` does in Rails.
|
|
208
284
|
`"automatic"` is the default. It prefers `SOLID_OBJECTS_REDIS_URL`, then
|
|
209
|
-
PostgreSQL notifications, then polling. `
|
|
285
|
+
PostgreSQL notifications, then polling. With `singleOwner`, the runtime runs no
|
|
286
|
+
selection and uses in-process signalling. `"in_process"` opts out, `"postgresql"`
|
|
210
287
|
and `"redis"` force one, and an unknown name throws rather than polls quietly.
|
|
211
288
|
|
|
212
289
|
A requested adapter that the environment cannot provide polls instead and says
|
package/docs/correctness.md
CHANGED
|
@@ -36,9 +36,10 @@
|
|
|
36
36
|
- Observable outbox rows are claimed in actor revision order. Subscription
|
|
37
37
|
sessions and browser clients reject duplicate or stale revisions within an
|
|
38
38
|
incarnation, while a recreated actor starts a new revision sequence.
|
|
39
|
-
- Wake-up notifications happen only after commit and never replace polling
|
|
40
|
-
Workers watch before claiming, so
|
|
41
|
-
claim and the following wait is
|
|
39
|
+
- Wake-up notifications happen only after commit and never replace polling,
|
|
40
|
+
except with [`singleOwner`](#single-owner). Workers watch before claiming, so
|
|
41
|
+
an in-process notification between an empty claim and the following wait is
|
|
42
|
+
retained.
|
|
42
43
|
- Activation passes are bounded. Yielding changes ready-membership polling
|
|
43
44
|
order only; it neither changes durable message sequence nor makes future work
|
|
44
45
|
due early.
|
|
@@ -65,6 +66,56 @@
|
|
|
65
66
|
delivery. A state change on an actor with payloads creates a revision
|
|
66
67
|
broadcast, even when that actor declares no scalar observables.
|
|
67
68
|
|
|
69
|
+
## Single owner
|
|
70
|
+
|
|
71
|
+
With `singleOwner: true`, an idle runtime sends no query, and it still runs all
|
|
72
|
+
work when the work arrives or comes due. This guarantee holds only while one
|
|
73
|
+
process writes the database.
|
|
74
|
+
|
|
75
|
+
The guarantee rests on these rules:
|
|
76
|
+
|
|
77
|
+
- Every write that adds work or moves it earlier happens in this process. After
|
|
78
|
+
the commit, the write notifies an in-process signal for each role that must
|
|
79
|
+
react. A host that enqueues with
|
|
80
|
+
`runtime.enqueueInternalMessageInTransaction()` must call
|
|
81
|
+
`runtime.announceInternalMessage()` after its commit, as it must without the
|
|
82
|
+
option. Without that call, the message waits for the next wake-up.
|
|
83
|
+
- A role watches the signal before it claims, so it cannot lose a notification
|
|
84
|
+
that arrives during a pass.
|
|
85
|
+
- After an empty pass, a role reads the earliest time at which a claim can take
|
|
86
|
+
something. The read uses the same conditions as the claims: the head of each
|
|
87
|
+
mailbox, lease ends, pending effects, broadcasts, and reminders, claims whose
|
|
88
|
+
owners become stale, and recovery timeouts. The role waits until that time,
|
|
89
|
+
or for at most 24 hours.
|
|
90
|
+
- A claim writes the row of the claiming worker in the claim transaction. A
|
|
91
|
+
worker that was idle for longer than `processAliveThresholdMilliseconds`
|
|
92
|
+
therefore never holds work under a stale row, and the alive rule protects
|
|
93
|
+
running work as it does without the option.
|
|
94
|
+
|
|
95
|
+
Fencing and at-least-once delivery do not change. Claims, activation leases,
|
|
96
|
+
the commit fence, retries, dead letters, and effect recovery use the same rows
|
|
97
|
+
and the same conditions.
|
|
98
|
+
|
|
99
|
+
The guarantee has these limits:
|
|
100
|
+
|
|
101
|
+
- One process only. A write from another process, for example a second
|
|
102
|
+
runtime, a script, or a command, does not wake this runtime. That work waits
|
|
103
|
+
for the next local wake-up or due time, for at most 24 hours.
|
|
104
|
+
- The start check reads the process rows once. It sees another writer only
|
|
105
|
+
while that writer's row is fresh, and an idle single owner does not refresh
|
|
106
|
+
its row. Two processes that start at the same moment can both pass the
|
|
107
|
+
check. Only an operating system lock, such as SQLite's exclusive locking
|
|
108
|
+
mode, keeps a second process out.
|
|
109
|
+
- A due time runs on a Node timer. A long synchronous handler delays the timer,
|
|
110
|
+
as it delays polling. Node timers stop while the computer sleeps. A watch
|
|
111
|
+
sees the jump of the wall clock within 10 seconds and makes every role read
|
|
112
|
+
its due time again, so work that came due during a sleep runs at most about
|
|
113
|
+
10 seconds after the computer wakes.
|
|
114
|
+
- When a due time is now or has passed and a claim still finds nothing, for
|
|
115
|
+
example after an actor setup failure, the role retries after 1 ms and then
|
|
116
|
+
doubles the wait up to its polling interval. Stuck work is then retried at
|
|
117
|
+
the polling interval, as it is without the option.
|
|
118
|
+
|
|
68
119
|
## Limitations and non-goals
|
|
69
120
|
|
|
70
121
|
- At-least-once execution means actor code may begin more than once. State and
|
|
@@ -83,6 +83,10 @@ stable public code and does not classify the operation as failed.
|
|
|
83
83
|
lookup found no record.
|
|
84
84
|
- `ReminderNotPaused` means only a completed reminder remains; schedule it
|
|
85
85
|
again through its actor instead of resuming it.
|
|
86
|
+
- `SingleOwnerConflict` means a `singleOwner` runtime found another live
|
|
87
|
+
process row at start. Its `processes` list names each row and the time at
|
|
88
|
+
which the row becomes stale. Stop the other process, or wait until that time,
|
|
89
|
+
and start again.
|
|
86
90
|
|
|
87
91
|
Realtime protocol validation uses `TypeError` for malformed subscription or
|
|
88
92
|
browser envelopes. Server delivery failures are isolated to the session and
|
package/docs/operations.md
CHANGED
|
@@ -7,7 +7,8 @@ and work enqueued with `send` stays ready until some process runs the roles.
|
|
|
7
7
|
A direct call or an explicit `sync` needs no running role, because the caller's
|
|
8
8
|
own path executes it.
|
|
9
9
|
|
|
10
|
-
Runtime roles use durable polling as the correctness fallback
|
|
10
|
+
Runtime roles use durable polling as the correctness fallback, unless the
|
|
11
|
+
runtime runs as a [single owner](#single-owner). Consecutive
|
|
11
12
|
empty passes double each role's wait from `pollingIntervalMilliseconds` to
|
|
12
13
|
`idlePollingIntervalMilliseconds`, which defaults to one second. Processed
|
|
13
14
|
work and wake-up notifications reset the role to the fast interval. Actor
|
|
@@ -149,10 +150,10 @@ state from reconciliation code.
|
|
|
149
150
|
The runtime automatically prunes expired message and stopped-process history
|
|
150
151
|
once at startup and every `retentionIntervalMilliseconds`, which defaults to
|
|
151
152
|
one hour. Stale process ownership is recovered independently every
|
|
152
|
-
`deadProcessCleanupIntervalMilliseconds`, which defaults to one minute.
|
|
153
|
-
interval to zero to disable its
|
|
154
|
-
events and retry with bounded
|
|
155
|
-
runtime roles.
|
|
153
|
+
`deadProcessCleanupIntervalMilliseconds`, which defaults to one minute. A
|
|
154
|
+
single owner recovers it once, at start. Set an interval to zero to disable its
|
|
155
|
+
scheduler. Failed passes emit metadata-only events and retry with bounded
|
|
156
|
+
exponential backoff without stopping other runtime roles.
|
|
156
157
|
|
|
157
158
|
Operators can also use `runtime.retention.preview()` and
|
|
158
159
|
`runtime.retention.prune()`. Both calls require administration authorization;
|
|
@@ -228,6 +229,45 @@ Scheduling an existing actor operation for a different time emits
|
|
|
228
229
|
`solid_objects.reminder.replaced` after the fenced actor commit. Scheduling it
|
|
229
230
|
for the same time emits nothing.
|
|
230
231
|
|
|
232
|
+
## Single owner
|
|
233
|
+
|
|
234
|
+
With [`singleOwner: true`](configuration.md#single-owner), an idle runtime sends
|
|
235
|
+
no query. Its roles wake for an in-process notification, for a due time that
|
|
236
|
+
the database reports, or after the wall clock jumps. Expect these differences
|
|
237
|
+
from the default:
|
|
238
|
+
|
|
239
|
+
- `runtime.administration.processes()` reports the rows of an idle single owner
|
|
240
|
+
as `stale`, because a role writes its row only at start, at shutdown, and
|
|
241
|
+
when it claims work. The `runtime` doctor check can report no live roles for
|
|
242
|
+
the same reason. Both are normal while the runtime is idle.
|
|
243
|
+
- The `wakeUp` doctor check passes with in-process signalling, because no other
|
|
244
|
+
process writes the database.
|
|
245
|
+
- `cleanup()` can mark the rows of an idle single owner `stopped`. The next
|
|
246
|
+
claim of each role writes its row again. An idle role holds no claim, so the
|
|
247
|
+
cleanup releases nothing.
|
|
248
|
+
- `currentPollingIntervalMilliseconds` and the
|
|
249
|
+
`solid_objects.polling.interval_changed` events describe only the retry of
|
|
250
|
+
due work that a claim cannot take.
|
|
251
|
+
|
|
252
|
+
`run()` refuses to start with `SingleOwnerConflict` when another process row is
|
|
253
|
+
alive. A process that stopped without cleanup stays alive until its heartbeat
|
|
254
|
+
is older than `processAliveThresholdMilliseconds`. The error gives that time
|
|
255
|
+
for each row. Stop the other process, or wait until that time, and start again.
|
|
256
|
+
|
|
257
|
+
The start check reads the process rows once. It sees another writer only while
|
|
258
|
+
that writer's row is fresh, and an idle single owner does not refresh its row.
|
|
259
|
+
For a guarantee that the operating system enforces, take an exclusive lock on
|
|
260
|
+
the file before the runtime writes to it:
|
|
261
|
+
|
|
262
|
+
```typescript
|
|
263
|
+
const database = sqlite({ path: "app.sqlite" })
|
|
264
|
+
await database.connection((connection) => connection.run("PRAGMA locking_mode = EXCLUSIVE"))
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
SQLite then holds the lock from the first write until the database closes. A
|
|
268
|
+
second process, including the `solid-objects` command for the same file, gets
|
|
269
|
+
`database is locked`.
|
|
270
|
+
|
|
231
271
|
## Dead letters, retry, and redrive
|
|
232
272
|
|
|
233
273
|
A handler failure that exhausts its attempts becomes a dead letter.
|
package/docs/releasing.md
CHANGED
|
@@ -65,3 +65,30 @@ from the tag and redeploy the site. The site's `check:release` step refuses a
|
|
|
65
65
|
snapshot that is not the latest published tag. The Context7 refresh workflow
|
|
66
66
|
refreshes the index after each push to `main` that changes the documentation.
|
|
67
67
|
Confirm that its run succeeded.
|
|
68
|
+
|
|
69
|
+
## Performance evidence
|
|
70
|
+
|
|
71
|
+
A version bump does not update the measured version of an existing benchmark dataset.
|
|
72
|
+
Keep each baseline's original source, environment, durability settings and raw samples.
|
|
73
|
+
If a release has no measurements, say so explicitly. A single-version baseline or a
|
|
74
|
+
different machine's results cannot establish a release-to-release regression or speedup.
|
|
75
|
+
|
|
76
|
+
For a numerical performance claim, run the selected releases on the same isolated host
|
|
77
|
+
with the same Node version, dependency lock, harness and workload parameters. Record actual
|
|
78
|
+
database durability; WAL/NORMAL and WAL/FULL are separate conditions. Retain every sample
|
|
79
|
+
and any interrupted attempts. Archive results and verify teardown before publishing them.
|
|
80
|
+
|
|
81
|
+
Register completed results in `benchmarks/results/index.json`, retain incomplete attempts
|
|
82
|
+
under its diagnostics list, and regenerate guide headlines with
|
|
83
|
+
`pnpm run check:benchmarks --write-guide`. The normal quality checks verify version labels,
|
|
84
|
+
raw samples, readiness evidence, summaries and published tables. See
|
|
85
|
+
[Benchmarks](benchmarks.md) for the datasets and measurement boundaries.
|
|
86
|
+
|
|
87
|
+
If one backend fails after other predeclared backend plans completed, keep the parent status
|
|
88
|
+
failed and preserve its original full plan and all diagnostics. After export, run
|
|
89
|
+
`node benchmarks/summarize-completed.mjs EXPORTED_DIAGNOSTIC_DIRECTORY` to derive every fully
|
|
90
|
+
completed backend. Register that archive as `partial-controlled-comparison`, with its exact
|
|
91
|
+
`databases` scope. CI requires all planned versions, rounds and scenarios for each included
|
|
92
|
+
backend, rejects selective subsets, and requires the report to remain visibly labeled incomplete.
|
|
93
|
+
Failed or partially sampled backends receive no comparative throughput claim. A new host's
|
|
94
|
+
replacement measurements remain a separate dataset.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-objects",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Fix race conditions across Node.js processes: ordered operations, expiring holds, and state that survives a restart, in your SQL database. A SQL-backed virtual actor library for TypeScript and Node.js.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"deploy:cloudflare": "wrangler deploy --config examples/cloudflare/wrangler.jsonc",
|
|
112
112
|
"check:cloudflare": "node scripts/check-cloudflare-imports.mjs && tsc -p tsconfig.cloudflare-example.json --noEmit && wrangler deploy --dry-run --config examples/cloudflare/wrangler.jsonc",
|
|
113
113
|
"build": "pnpm run clean && tsc -p tsconfig.build.json && tsc -p tsconfig.cloudflare-build.json && tsc -p tsconfig.quickstart-build.json && node scripts/prepare-executable.mjs",
|
|
114
|
-
"check": "pnpm run check:parameters && pnpm run check:documentation && pnpm run check:browser-imports && tsc -p tsconfig.json --noEmit && tsc -p tsconfig.examples.json --noEmit && tsc -p tsconfig.cloudflare.json --noEmit && tsc -p tsconfig.benchmarks.json",
|
|
114
|
+
"check": "pnpm run check:parameters && pnpm run check:documentation && pnpm run check:benchmarks && pnpm run check:browser-imports && tsc -p tsconfig.json --noEmit && tsc -p tsconfig.examples.json --noEmit && tsc -p tsconfig.cloudflare.json --noEmit && tsc -p tsconfig.benchmarks.json",
|
|
115
115
|
"check:browser-imports": "node scripts/check-browser-imports.mjs",
|
|
116
116
|
"check:documentation": "node scripts/check-documentation.mjs",
|
|
117
117
|
"check:parameters": "node scripts/check-parameter-style.mjs",
|
|
@@ -132,7 +132,8 @@
|
|
|
132
132
|
"benchmark:idle": "pnpm run build && node benchmarks/idle.ts",
|
|
133
133
|
"benchmark:large-state": "pnpm run build && node benchmarks/large-state.ts",
|
|
134
134
|
"pack:check": "pnpm pack --dry-run && node scripts/check-package.mjs",
|
|
135
|
-
"prepack": "pnpm run build"
|
|
135
|
+
"prepack": "pnpm run build",
|
|
136
|
+
"check:benchmarks": "node benchmarks/check-results.mjs"
|
|
136
137
|
},
|
|
137
138
|
"devDependencies": {
|
|
138
139
|
"@cloudflare/vitest-plugin": "^1.1.4",
|