Fixed signature

This commit is contained in:
Brage Skjønborg 2025-10-12 19:54:11 +02:00
parent 597adb36bc
commit c6d842aefc
4 changed files with 5 additions and 5 deletions

View File

@ -12,10 +12,10 @@ import kotlin.coroutines.cancellation.CancellationException
/**
* Abstract base class for handling tasks with asynchronous processing and reporting.
*
* @param T The type of result produced by processing the task.
* @param reporter An instance of [TaskReporter] for reporting task status and events.
*/
abstract class TaskListener<T>(val taskType: TaskType = TaskType.CPU_INTENSIVE): TaskListenerImplementation {
abstract class TaskListener(val taskType: TaskType = TaskType.CPU_INTENSIVE): TaskListenerImplementation {
init {
TaskListenerRegistry.registerListener(this)

View File

@ -2,6 +2,6 @@ package no.iktdev.eventi.tasks
import no.iktdev.eventi.ListenerRegistryImplementation
object TaskListenerRegistry: ListenerRegistryImplementation<TaskListener<*>>() {
object TaskListenerRegistry: ListenerRegistryImplementation<TaskListener>() {
}

View File

@ -57,7 +57,7 @@ class AbstractTaskPollerTest : TestBase() {
}
open class EchoListener : TaskListener<String>(TaskType.MIXED) {
open class EchoListener : TaskListener(TaskType.MIXED) {
var result: Event? = null
override fun getWorkerId() = this.javaClass.simpleName

View File

@ -15,7 +15,7 @@ fun TaskListenerRegistry.wipe() {
// Tøm mapen
val mutableList = field.get(TaskListenerRegistry) as MutableList<*>
(mutableList as MutableList<Class<out TaskListener<*>>>).clear()
(mutableList as MutableList<Class<out TaskListener>>).clear()
// Verifiser at det er tomt
assertThat(TaskListenerRegistry.getListeners().isEmpty())