-
Notifications
You must be signed in to change notification settings - Fork 739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migration to coroutines #3445
Migration to coroutines #3445
Conversation
CC @Dominaezzz if you want to have a look :) |
@@ -44,35 +43,33 @@ internal class DefaultTypingService @AssistedInject constructor( | |||
fun create(roomId: String): DefaultTypingService | |||
} | |||
|
|||
private var currentTask: Cancelable? = null | |||
private var currentAutoStopTask: Cancelable? = null | |||
private var job = Job() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be a CoroutineScope
instead of Job
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you would replace private var job = Job()
by private var coroutineScope = CoroutineScope(Job())
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private var coroutineScope = CoroutineScope()
Job
is added by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The constructor of CoroutineScope
requires a context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, maybe I'm using a different version.
Well, it's the same either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the typing methods, otherwise LGTM
949818c
to
f7f4ec3
Compare
Part of #2449: migrate DefaultTypingService, KeysImporter and KeysExporter to coroutines