-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
Are there any examples or documentation on creating temporal rooms with a Time to Live option ?
It differs in a specific way: There's no "terminate" handler, because a Durable Object can "shut down" / get evicted at any time, and we can't reliably call a "terminate" handler. Instead, you can set an alarm to run some cleanup code at some point in the future.
For the TTL feature I added a schedule alarm to trigger a cleanup function as suggested on the docs:
async cleanup () {
await this.ctx.storage.deleteAlarm();
await this.ctx.storage.deleteAll();
}
I'm still unsure how to force an eviction or actually delete the room if possible.
Related issue ? #25
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels