Skip to content

Commit

Permalink
version 2.3.0
Browse files Browse the repository at this point in the history
update infrastructure:
kotlin 1.7.21 -> 1.9.22
dokka 1.7.20 -> 1.9.10
coroutines 1.6.4 -> 1.7.3
kotlin-logging 3.0.4 -> 6.0.1
kotlin-csv-jvm 1.6.0 -> 1.9.3
  • Loading branch information
RationalityFrontline committed Feb 16, 2024
1 parent 2b0ba34 commit 4d5f544
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# KEvent
[![Maven Central](https://img.shields.io/maven-central/v/org.rationalityfrontline/kevent.svg?label=maven%20central)](https://search.maven.org/search?q=g:%22org.rationalityfrontline%22%20AND%20a:%22kevent%22)
[![Kotlin 1.7.21](https://img.shields.io/badge/kotlin-1.7.21-blue.svg)](http://kotlinlang.org)
[![Kotlin 1.9.22](https://img.shields.io/badge/kotlin-1.9.22-blue.svg)](http://kotlinlang.org)
![JDK](https://img.shields.io/badge/jdk-%3E%3D11-orange)
[![Apache License 2.0](https://img.shields.io/github/license/rationalityfrontline/kevent)](https://github.com/RationalityFrontline/kevent/blob/master/LICENSE)
[![Awesome Kotlin Badge](https://kotlin.link/awesome-kotlin.svg)](https://github.com/KotlinBy/awesome-kotlin)
Expand Down Expand Up @@ -35,15 +35,15 @@ A powerful in-process event dispatcher based on Kotlin and Coroutines.
## Download
**Gradle Kotlin DSL**
```kotlin
implementation("org.rationalityfrontline:kevent:2.2.0")
implementation("org.rationalityfrontline:kevent:2.3.0")
```

**Maven**
```xml
<dependency>
<groupId>org.rationalityfrontline</groupId>
<artifactId>kevent</artifactId>
<version>2.2.0</version>
<version>2.3.0</version>
</dependency>
```

Expand Down Expand Up @@ -165,7 +165,7 @@ JDK: OpenJDK 17+35-2724 64 bit
KEvent is released under the [Apache 2.0 license](https://github.com/RationalityFrontline/kevent/blob/master/LICENSE).

```text
Copyright 2020-2022 RationalityFrontline
Copyright 2020-2024 RationalityFrontline
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
12 changes: 6 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.7.21"
kotlin("jvm") version "1.9.22"
`java-library`
`maven-publish`
signing
id("org.jetbrains.dokka") version "1.7.20"
id("org.jetbrains.dokka") version "1.9.10"
id("org.javamodularity.moduleplugin") version "1.8.12"
}

group = "org.rationalityfrontline"
version = "2.2.0"
version = "2.3.0"
val NAME = "kevent"
val DESC = "A powerful in-process event dispatcher based on Kotlin and Coroutines"
val GITHUB_REPO = "RationalityFrontline/kevent"
Expand All @@ -20,15 +20,15 @@ repositories {
}

dependencies {
val coroutinesVersion = "1.6.4"
val coroutinesVersion = "1.7.3"
/** Kotlin --------------------------------------------------------- */
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:$coroutinesVersion")
/** Logging -------------------------------------------------------- */
implementation("io.github.microutils:kotlin-logging:3.0.4")
implementation("io.github.oshai:kotlin-logging-jvm:6.0.3")
/** Testing -------------------------------------------------------- */
val spekVersion = "2.0.19"
testImplementation("org.slf4j:slf4j-simple:2.0.4")
testImplementation("com.github.doyaaaaaken:kotlin-csv-jvm:1.6.0")
testImplementation("com.github.doyaaaaaken:kotlin-csv-jvm:1.9.3")
testImplementation(kotlin("test"))
testImplementation("org.spekframework.spek2:spek-dsl-jvm:$spekVersion")
testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:$spekVersion")
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/module-info.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module kevent {
//kotlin
requires kotlin.stdlib;
requires kotlinx.coroutines.core.jvm;
requires kotlinx.coroutines.core;
//logging
requires io.github.microutils.kotlinlogging;
requires io.github.oshai.kotlinlogging;

exports org.rationalityfrontline.kevent;
}
8 changes: 4 additions & 4 deletions src/main/kotlin/org/rationalityfrontline/kevent/KEvent.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020-2022 RationalityFrontline
* Copyright 2020-2024 RationalityFrontline
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,7 +22,7 @@ package org.rationalityfrontline.kevent
import kotlinx.coroutines.*
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.flow.consumeAsFlow
import mu.KotlinLogging
import io.github.oshai.kotlinlogging.KotlinLogging
import java.util.*
import java.util.concurrent.ConcurrentHashMap
import kotlin.coroutines.CoroutineContext
Expand Down Expand Up @@ -178,7 +178,7 @@ class KEvent(
scope.launch {
eventChannel.consumeAsFlow().collect { event ->
val subscriberList = subscribersReadOnlyMap[event.type]
if (subscriberList == null || subscriberList.isEmpty()) {
if (subscriberList.isNullOrEmpty()) {
if (!event.isSticky) logger.trace { "No subscriber for event type \"${event.type.name}\"" }
} else {
val e = if (event.isSticky) event.copy(isSticky = false) else event
Expand Down Expand Up @@ -278,7 +278,7 @@ class KEvent(
val subscriberList = subscribersReadOnlyMap[event.type]?.run {
filter { it.threadMode == SubscriberThreadMode.POSTING }
}
if (subscriberList == null || subscriberList.isEmpty()) {
if (subscriberList.isNullOrEmpty()) {
logger.trace { "No subscriber for event type \"${event.type.name}\" with dispatch mode ${EventDispatchMode.POSTING}" }
return false
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020-2022 RationalityFrontline
* Copyright 2020-2024 RationalityFrontline
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.rationalityfrontline.kevent

import com.github.doyaaaaaken.kotlincsv.dsl.csvWriter
import mu.KotlinLogging
import io.github.oshai.kotlinlogging.KotlinLogging
import java.io.File
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
Expand Down

0 comments on commit 4d5f544

Please sign in to comment.