Skip to content

Commit

Permalink
set default service context to EmptyCoroutineContext
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoferrer committed Feb 18, 2019
1 parent aaf392a commit 4434d10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ object GrpcCoroutinesGenerator : Generator {
.addModifiers(KModifier.OVERRIDE)
.getter(
FunSpec.getterBuilder()
.addCode("return %T.Default", CommonClassNames.dispatchers)
.addCode("return %T", CommonClassNames.emptyCoroutineContext)
.build()
)
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.channels.ReceiveChannel
import kotlinx.coroutines.channels.SendChannel
import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.EmptyCoroutineContext


object CommonClassNames{

val bindableService: ClassName = BindableService::class.asClassName()
val coroutineScope: ClassName = CoroutineScope::class.asClassName()
val coroutineContext: ClassName = CoroutineContext::class.asClassName()
val emptyCoroutineContext: ClassName = EmptyCoroutineContext::class.asClassName()
val receiveChannel: ClassName = ReceiveChannel::class.asClassName()
val sendChannel: ClassName = SendChannel::class.asClassName()
val dispatchers: ClassName = Dispatchers::class.asClassName()
Expand Down

0 comments on commit 4434d10

Please sign in to comment.