mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 11:24:35 -05:00
Subscriptions!
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
package suwayomi.tachidesk.graphql.subscriptions
|
||||
|
||||
import graphql.schema.DataFetchingEnvironment
|
||||
import reactor.core.publisher.Flux
|
||||
import suwayomi.tachidesk.graphql.server.subscriptions.FluxSubscriptionSource
|
||||
import suwayomi.tachidesk.graphql.types.DownloadType
|
||||
import suwayomi.tachidesk.manga.impl.download.model.DownloadChapter
|
||||
|
||||
val downloadSubscriptionSource = FluxSubscriptionSource<DownloadChapter>()
|
||||
|
||||
class DownloadSubscription {
|
||||
fun downloadChanged(dataFetchingEnvironment: DataFetchingEnvironment): Flux<DownloadType> {
|
||||
return downloadSubscriptionSource.emitter.map { downloadChapter ->
|
||||
DownloadType(downloadChapter)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user