Skip to content

Commit

Permalink
V 0.4.0.0; services di to factory (should be killed on service death)
Browse files Browse the repository at this point in the history
  • Loading branch information
dinaraparanid committed May 18, 2024
1 parent f707450 commit e46112a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import kotlinx.coroutines.withTimeoutOrNull
import java.io.File
import java.util.concurrent.atomic.AtomicLong

private const val TAG = "Ktor Client"
private const val TAG = "KtorClient"

private const val NEXT_PACKET_TIMEOUT = 3000L

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import com.paranid5.crescendo.system.services.stream.StreamServiceAccessor
import com.paranid5.crescendo.system.services.stream.extractor.UrlExtractor
import com.paranid5.crescendo.system.services.stream.notification.NotificationManager
import com.paranid5.crescendo.system.services.stream.playback.PlayerProvider
import org.koin.core.module.dsl.factoryOf
import org.koin.core.module.dsl.singleOf
import org.koin.dsl.module

val streamServiceModule = module {
singleOf(::StreamServiceAccessor)
single { params -> PlayerProvider(params.get(), get()) }
singleOf(::UrlExtractor)
single { params -> NotificationManager(params.get(), get()) }
factory { params -> PlayerProvider(params.get(), get()) }
factoryOf(::UrlExtractor)
factory { params -> NotificationManager(params.get(), get()) }
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ import org.koin.dsl.module

val trackServiceModule = module {
singleOf(::TrackServiceAccessor)
single { params -> PlayerProvider(params.get(), get(), get()) }
single { params -> NotificationManager(params.get(), get(), get()) }
factory { params -> PlayerProvider(params.get(), get(), get()) }
factory { params -> NotificationManager(params.get(), get(), get()) }
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import com.paranid5.crescendo.system.services.video_cache.extractor.UrlExtractor
import com.paranid5.crescendo.system.services.video_cache.files.MediaFileDownloader
import com.paranid5.crescendo.system.services.video_cache.files.VideoQueueManager
import com.paranid5.crescendo.system.services.video_cache.notification.NotificationManager
import org.koin.core.module.dsl.factoryOf
import org.koin.core.module.dsl.singleOf
import org.koin.dsl.module

val videoCacheServiceModule = module {
singleOf(::VideoCacheServiceAccessor)
singleOf(::VideoQueueManager)
single { params -> NotificationManager(params.get()) }
singleOf(::CacheManager)
singleOf(::UrlExtractor)
singleOf(::MediaFileDownloader)
factoryOf(::VideoQueueManager)
factory { params -> NotificationManager(params.get()) }
factoryOf(::CacheManager)
factoryOf(::UrlExtractor)
factoryOf(::MediaFileDownloader)
}

0 comments on commit e46112a

Please sign in to comment.