consumer #2

Merged
usbharu merged 10 commits from consumer into master 2024-04-30 09:26:10 +00:00
5 changed files with 7 additions and 10 deletions
Showing only changes of commit 54b1cbde9c - Show all commits

View File

@ -16,8 +16,6 @@
package dev.usbharu.owl.consumer
import dev.usbharu.dev.usbharu.owl.consumer.TaskRequest
import dev.usbharu.dev.usbharu.owl.consumer.TaskRunner
import dev.usbharu.owl.*
import dev.usbharu.owl.Uuid.UUID
import dev.usbharu.owl.common.property.PropertySerializeUtils

View File

@ -16,7 +16,6 @@
package dev.usbharu.owl.consumer
import dev.usbharu.dev.usbharu.owl.consumer.TaskRunner
import dev.usbharu.owl.AssignmentTaskServiceGrpcKt
import dev.usbharu.owl.SubscribeTaskServiceGrpcKt
import dev.usbharu.owl.TaskResultServiceGrpcKt
@ -50,8 +49,7 @@ class StandaloneConsumer(
private val taskRunnerMap = ServiceLoader
.load(TaskRunner::class.java)
.associateBy { it::class.qualifiedName!! }
.filterNot { it.key.isBlank() }
.associateBy { it.name }
private val consumer = Consumer(
subscribeStub,

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package dev.usbharu.dev.usbharu.owl.consumer
package dev.usbharu.owl.consumer
import dev.usbharu.owl.common.property.PropertyValue
import java.time.Instant

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package dev.usbharu.dev.usbharu.owl.consumer
package dev.usbharu.owl.consumer
import dev.usbharu.owl.common.property.PropertyValue

View File

@ -14,8 +14,9 @@
* limitations under the License.
*/
package dev.usbharu.dev.usbharu.owl.consumer
package dev.usbharu.owl.consumer
fun interface TaskRunner {
suspend fun run(taskRequest: TaskRequest):TaskResult
interface TaskRunner {
val name: String
suspend fun run(taskRequest: TaskRequest): TaskResult
}