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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11624a306bdeca71c5da082c39329f579c8d5d9b88945db2e49b534d2c317bc2
4
- data.tar.gz: 7ac2b6c343b243169f92273179591db817a0e51c24e0312eaa59f8ee46c1e17f
3
+ metadata.gz: e6230f0722b011cd685875a291ba17f1435712928c4af1881b692045fbf6f3ab
4
+ data.tar.gz: edfbf33e568b2c0e921deea594feeb41152e3bf854271625ca7923b3a28da466
5
5
  SHA512:
6
- metadata.gz: dbf6ea115998afb97d759724469a29d8dfffa832ca52a6713027cbc5822d56ce2e40b55213deadefc598636beddeaebb49777e3e59d61a20b344a6b8bba1c670
7
- data.tar.gz: 29e113dbdb487e5eaf3d9061dc494c6e6aaa54e2bf5fc2eba1bcd0e4a9db7684a1a7bffb65efc69cd0436d07c2b5e9523ab9075d8652f0c005affe545fd3d52e
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
- Solid Objects has no `unschedule`. A reminder stops when its handler does not
133
- re-arm it, and destroying an actor removes its reminders.
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
@@ -1,5 +1,5 @@
1
1
  # rbs_inline: enabled
2
2
 
3
3
  module SolidObjects
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.1"
5
5
  end
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.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-13 00:00:00.000000000 Z
11
+ date: 2026-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actioncable