In the `SimplifiedSessionStorage` example on <http...
# ktor
m
In the
SimplifiedSessionStorage
example on https://ktor.io/servers/features/sessions/storages.html, what is the (not shown)
getCoroutineContext()
supposed to do in practice? Also that form of
reader()
is deprecated now --
CoroutineScope.reader
is probably what it should be, but on what scope?
📝 1
1
d
That looks like outdated
There is an intrinsic called
coroutineContext
that should replace the
getCoroutineContext
About the reader part, let me check
m
that makes much more sense
d
yeah I have still to revisit every single page now that Kotlin 1.3 and kotlinx.coroutines 1.0.0 are released and are stable (and Ktor is almost there)
m
we appreciate the effort put into the docs 🙂
simple smile 1
👌 2
Maybe I'm missing something about coroutine scopes (quite plausible) but it seems like this should be attached to the scope of a call, but how would that scope make its way down to this level if it's not passed as an argument to
SessionStorage
methods?
d
CoroutineScope(<http://Dispatchers.IO|Dispatchers.IO>)
?
No scope is propagated
so right now it is not attached
m
I see. I'm still pretty fuzzy on how best to use scopes, but CoroutineScope(Dispatchers.IO) seems defensible
d
but it is really necessary that it is attached? Since those I/O stuff should be short and usually request/response, or even long lived
m
I'm not really sure
d
but I don’t have a strong opinion on this either
m
I just want the IDE to not be mad at me 😉
d
🙂