feat: Producerのデフォルト実装を追加
This commit is contained in:
@@ -18,6 +18,12 @@ package dev.usbharu.owl.common.task
|
||||
|
||||
import dev.usbharu.owl.common.property.PropertyType
|
||||
|
||||
class PropertyDefinition(val map: Map<String, PropertyType>) : Map<String, PropertyType> by map{
|
||||
class PropertyDefinition(val map: Map<String, PropertyType>) : Map<String, PropertyType> by map {
|
||||
fun hash(): Long {
|
||||
var hash = 1L
|
||||
map.map { it.key + it.value.name }.joinToString("").map { hash *= it.code * 31 }
|
||||
return hash
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -17,15 +17,15 @@
|
||||
package dev.usbharu.owl.common.task
|
||||
|
||||
import dev.usbharu.owl.common.property.PropertyValue
|
||||
import dev.usbharu.owl.common.retry.RetryPolicy
|
||||
|
||||
interface TaskDefinition<T : Task> {
|
||||
val name: String
|
||||
val priority: Int
|
||||
val maxRetry: Int
|
||||
val retryPolicy:RetryPolicy
|
||||
val retryPolicy: String
|
||||
val timeoutMilli: Long
|
||||
val propertyDefinition: PropertyDefinition
|
||||
val type: Class<T>
|
||||
|
||||
fun serialize(task: T): Map<String, PropertyValue<*>>
|
||||
fun deserialize(value: Map<String, PropertyValue<*>>): T
|
||||
|
||||
Reference in New Issue
Block a user