BufferedSessionService
Parameters
The store the writes are persisted to, which close leaves open; its SessionService.appendEvent receives a Session with only the key and the Session.lastUpdateTime the write replaces, so it must persist from the event alone. A retry after an attempt that failed but was persisted resends the event with that same Session.lastUpdateTime, so the store should treat an event it already holds as persisted, rather than store it twice or, with a stale-write check, reject it and fail the session. A call that never returns holds back the session's later writes, the reads that wait for them, and close.
Where the writes run. They outlive the run that made them, so they take their own context rather than the caller's; a kotlinx.coroutines.Job in it becomes their parent and cannot complete until close. An Error in a write stops the service and fails like an uncaught child coroutine, canceling a parent job that is not a supervisor and reaching the context's exception handler or the platform default.
How failed writes are retried, and whether a read cache serves getSession.