Skip to content
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

Merged
merged 6 commits into from
Jun 9, 2021
Merged

Migration to coroutines #3445

merged 6 commits into from
Jun 9, 2021

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Jun 1, 2021

Part of #2449: migrate DefaultTypingService, KeysImporter and KeysExporter to coroutines

@bmarty bmarty requested a review from ganfra June 1, 2021 15:25
@bmarty
Copy link
Member Author

bmarty commented Jun 1, 2021

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()
Copy link
Contributor

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.

Copy link
Member Author

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()) ?

Copy link
Contributor

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.

Copy link
Member Author

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

Copy link
Contributor

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.

Copy link
Member

@ganfra ganfra left a 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

@bmarty bmarty force-pushed the feature/bma/withContext branch from 949818c to f7f4ec3 Compare June 9, 2021 13:41
@bmarty bmarty merged commit 2864101 into develop Jun 9, 2021
@bmarty bmarty deleted the feature/bma/withContext branch June 9, 2021 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants