-
-
Notifications
You must be signed in to change notification settings - Fork 411
-
-
Notifications
You must be signed in to change notification settings - Fork 411
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
Doubt #16
Comments
These annotations don't do much. They're like the comment to indicate which thread the function should be called from. This function is already |
Yeah, but why it's not @workerthread ? as It's a network request, it should be marked as @workerthread right ?
…On Fri, Apr 17, 2020, 1:41 PM Shreyas Patil ***@***.***> wrote:
These annotations don't do much. They're like the comment to indicate
which thread the function should be called from. This function is already
suspend. We're running flow on IO thread. That's why it doesn't matters
too much here.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#16 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACJ23RZWUJRHFAEVMJLRILTRNAFL3ANCNFSM4MKLYQ6Q>
.
|
It's not intentional. Just annotated it with @mainthread as convention (so many repos with same functionality were annotated it with @mainthread) |
@PatilShreyas Hi, obviously |
Hi, @DanteAndroid basically these annotations don't do much, they're like a comment to indicate which thread the function should be called from. This prevents the error of calling a function from other thread. Here, it means this function should be called from the main thread. |
First of all, awesome repository. Got a lot to learn in it. 😃
I've a doubt in your code.
Here,
Foodium/app/src/main/java/dev/shreyaspatil/foodium/data/repository/NetworkBoundRepository.kt
Lines 93 to 94 in 75e4541
Why did you marked
fetchFromRemote
with@MainThread
? Should it be called fromWorkerThread
? 🤔The text was updated successfully, but these errors were encountered: