You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -236,9 +236,12 @@ type StorageAdapter interface {
236
236
Save(events []Event) error
237
237
Load() ([]Event, error)
238
238
Clear() error
239
+
Close() error
239
240
}
240
241
```
241
242
243
+
The `Close()` method is called when the client is disposed, allowing storage adapters to release resources (e.g., close database connections, Redis clients, file handles).
Initializes the client and restores persisted events. Uses double-checked locking for thread safety. Resets the disposed state, so calling `Init()` after `Dispose()` re-enables the client.
For custom storage implementations (e.g., file, Redis, database), implement the `StorageAdapter` interface. See [adapters/README.md](./adapters/README.md) for examples.
266
+
269
267
## Concurrency Guarantees
270
268
271
269
-**Thread-Safe Flush**: Multiple concurrent `Flush()` calls are serialized via mutex
0 commit comments