ktor suspend fun
See original GitHub issuehi guys, this is more of a question rather than an issue, i’m trying this library to connect to API using ktor which depend on coroutines.
Let say i have http request
suspend fun getUser(): User {
return user
}
any suggestion how to convert into observable?
subject
.subscribeOn(ioScheduler)
.flatMapSingle { service.getUser() } -> here we're getting result from suspend fun
.observeOn(mainScheduler)
thanks guys
Issue Analytics
- State:
- Created 4 years ago
- Comments:36 (20 by maintainers)
Top Results From Across the Web
Proper way to call a suspended function in ktor - Stack Overflow
i would like to start a process is active while my ktor server is up. suspend fun doWork(){ while(true){ delay(2000L) printit("I did work")...
Read more >Understanding suspend function of Kotlin Coroutines - Medium
When we talk about coroutine, Suspend Functions are like its backbone. So it is very important to know what it is ... private...
Read more >Creating a client application - Ktor
In the next step, we'll make our main function suspending to fix this issue. Click the red bulb and choose Make main suspend....
Read more >Composing Coroutines and Suspend Functions - Baeldung
In this tutorial, we'll look into various types of coroutines we might want to create in our application and how to compose them...
Read more >How to use call.respond in non-suspended function. #101
I am using ktor 0.3.2 with netty, kotlin1.1 and Java8. ... inline suspend fun ApplicationCall.respond(message: Any) { ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@gotamafandy After #221 you should be able to write in the following normal way:
And keep
isThreadLocal=true
in the bindings.Makes sense. I will try to overcome this limitation in the upcoming release. Let’s keep this issue open.