Skip to Content
Motoko

Idle instances on this host

With the runtime's closeIdleAfterMs, an instance that went idle closes its SQLite connection and releases its lease, so a runtime in another process (with a lease that reaches it) can take the scope; the app's handles reopen it at their next call. This host's wake style is process, so the runtime itself reopens an instance closed with a sleep due later (a retry backoff, for example) when the sleep is due, and that timer keeps the Node.js process alive as pi-durable's own would. A MemoryStorage factory starts empty at every open, so it loses an idle instance's sessions: pair idle closing with a storage that outlives the instance, such as sqliteStorage.