solid_objects 1.0.0 → 1.0.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/docs/agents.md +2 -0
- data/docs/reminders.md +29 -2
- data/lib/solid_objects/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e6230f0722b011cd685875a291ba17f1435712928c4af1881b692045fbf6f3ab
|
|
4
|
+
data.tar.gz: edfbf33e568b2c0e921deea594feeb41152e3bf854271625ca7923b3a28da466
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f90a44f702083feb54a1679cb1ad25509275c7ffeea83ff09d45263031a49ca65078ce982405f4402361e6e668830a537b2a6e177cbed89ee0cc9ff9016b4738
|
|
7
|
+
data.tar.gz: d632f853b9031d30416b5ba74ecce82cc39822327896024b0cf25846063ad0bf0fb341f887de0fd9d6c232b8eafd8e335e3209b066a965a9fcffa2fe5571c6a6
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.1 - 2026-10-14
|
|
4
|
+
|
|
5
|
+
- Correct `docs/reminders.md`, which said that Solid Objects has no
|
|
6
|
+
`unschedule`. The gem has `unschedule` and `unschedule_all`, and the guide
|
|
7
|
+
now has a section on how to cancel a reminder. The agent guide shows the
|
|
8
|
+
cancel call. A new test fails when the reminder guide does not name a public
|
|
9
|
+
reminder method of an actor.
|
|
10
|
+
|
|
3
11
|
## 1.0.0 - 2026-10-13
|
|
4
12
|
|
|
5
13
|
- Version 1.0 freezes the public API under semantic versioning.
|
data/docs/agents.md
CHANGED
|
@@ -169,6 +169,7 @@ Obey these rules in actor code:
|
|
|
169
169
|
- Keep state in `attribute` values. State must be JSON-compatible.
|
|
170
170
|
- Use `schedule(at:, key:)` for delayed work. A reminder is one named alarm
|
|
171
171
|
for each actor and key. A new `schedule` with the same key moves the alarm.
|
|
172
|
+
`unschedule(:expire, key: buyer)` cancels it.
|
|
172
173
|
- Use `reject(code, message)` for a business rule failure that must not retry.
|
|
173
174
|
It takes a code and a message, for example
|
|
174
175
|
`reject(:room_full, "The room is full")`.
|
|
@@ -191,6 +192,7 @@ Avoid these mistakes:
|
|
|
191
192
|
| `schedule(at: deadline)` with no operation after it | `schedule(at: deadline, key: buyer).expire(buyer:)`. A `schedule` call with no operation after it fails the turn with `SolidObjects::ScheduleWithoutOperation` |
|
|
192
193
|
| `reject "room full"` | `reject(:room_full, "The room is full")` |
|
|
193
194
|
| `id` inside an actor | `actor_id`. An actor has no `id` method |
|
|
195
|
+
| A guessed cancel method, such as `cancel_reminder` | `unschedule(:expire, key: buyer)`. `unschedule_all(:expire)` cancels every key of one operation |
|
|
194
196
|
| `register_effect(:name) { \|context, arguments\| ... }` | `register_effect(:name) { \|arguments, context\| ... }`. The arguments come first |
|
|
195
197
|
|
|
196
198
|
[Reminders](reminders.md) and the [architecture guide](architecture.md) give
|
data/docs/reminders.md
CHANGED
|
@@ -129,8 +129,35 @@ cannot strand an entry because the handler drains by time rather than by alarm.
|
|
|
129
129
|
Prefer it when the queue is large and the items are interchangeable; prefer
|
|
130
130
|
`key:` when an item needs its own alarm that can be moved on its own.
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
## Cancel a reminder
|
|
133
|
+
|
|
134
|
+
`unschedule` cancels one reminder: by operation, by operation and key, or by
|
|
135
|
+
the handle that the operation call on the `schedule` result returns.
|
|
136
|
+
`unschedule_all` cancels every key of one operation.
|
|
137
|
+
|
|
138
|
+
```ruby
|
|
139
|
+
def confirm(buyer:)
|
|
140
|
+
self.holds = holds.except(buyer)
|
|
141
|
+
unschedule(:expire, key: buyer)
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
def close_sale
|
|
145
|
+
unschedule_all(:expire)
|
|
146
|
+
end
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
A cancellation is staged like a schedule. It commits with the state change of
|
|
150
|
+
the same turn, and a turn that raises cancels nothing. A cancellation of a
|
|
151
|
+
reminder that does not exist is not an error. An unknown operation raises
|
|
152
|
+
`UnknownMessage`. A cancellation cannot recall an occurrence that the scheduler
|
|
153
|
+
already turned into a message.
|
|
154
|
+
|
|
155
|
+
A reminder also stops when its handler does not re-arm it, and the destruction
|
|
156
|
+
of an actor removes its reminders.
|
|
157
|
+
|
|
158
|
+
`reminder` returns the status of one reminder, or `nil`. `reminders` lists
|
|
159
|
+
every key of one operation. Both include the changes that the current turn
|
|
160
|
+
staged.
|
|
134
161
|
|
|
135
162
|
Self-scheduling actors should also have a low-frequency application reconciler.
|
|
136
163
|
It may read `SolidObjects::Instance.states_for`, `.without_pending_work`, and
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: solid_objects
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lucas Carlson
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actioncable
|