Как я объявляю свои модули внутри MainActivity.kt:
Код: Выделить всё
startKoin {
modules(
module {
single { CancelOrchestration() }
scope { scopedOf(::PaymentOrchestration) }
scope { scopedOf(::OfflinePaymentOrchestration) }
}
)
}
Код: Выделить всё
fun Route.paymentsController(){
// Using single instance works fine
val cancelOrchestration by inject()
post("/payments/{terminalsn?}"){
val requestId = UUID.randomUUID().toString()
//Using request scoped instance throws "Request scope is not ready"
val orchestration = if(TransactionData.isOffline || TransactionData.isOfflineForced) call.scope.get() else call.scope.get
()
}
}
Заранее большое спасибо!!!
Подробнее здесь: https://stackoverflow.com/questions/790 ... -not-ready
Мобильная версия