File tree 6 files changed +63
-6
lines changed
buildSrc/src/main/kotlin/changelog
simbot-api/src/commonMain/kotlin/love/forte/simbot/event
simbot-commons/simbot-common-suspend-runner/src/jvmTest/kotlin/love/forte/simbot/suspendrunner
6 files changed +63
-6
lines changed Original file line number Diff line number Diff line change
1
+ # v4.0.0-dev1
2
+ > [ !warning]
3
+ > 这是一个尚在开发中的** 预览版** ,它可能不稳定,可能会频繁变更,且没有可用性保证。
4
+
5
+
6
+ > Release & Pull Notes: [ v4.0.0-dev1] ( https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.0-dev1 )
7
+
8
+ - feat: Collectable ([ ` 5d145237 ` ] ( https://github.com/simple-robot/simpler-robot/commit/5d145237 ) )
9
+ - feat: ID、Timestamp and Job link ([ ` 60f8634f ` ] ( https://github.com/simple-robot/simpler-robot/commit/60f8634f ) )
10
+ - feat: Timestamp ([ ` 3db7aa8f ` ] ( https://github.com/simple-robot/simpler-robot/commit/3db7aa8f ) )
11
+ - feat: (WIP) multiplatform ID ([ ` 5eafba6e..1727015e ` ] ( https://github.com/simple-robot/simpler-robot/compare/5eafba6e..v3.3.0 ) )
12
+
13
+ <details ><summary ><code >5eafba6e..1727015e</code ></summary >
14
+
15
+ - [ ` 5eafba6e ` ] ( https://github.com/simple-robot/simpler-robot/commit/5eafba6e )
16
+ - [ ` 3e0919a2 ` ] ( https://github.com/simple-robot/simpler-robot/commit/3e0919a2 )
17
+ - [ ` 1727015e ` ] ( https://github.com/simple-robot/simpler-robot/commit/1727015e )
18
+
19
+ </details >
20
+
21
+
1
22
# v3.3.0
2
23
3
24
> Release & Pull Notes: [ v3.3.0] ( https://github.com/simple-robot/simpler-robot/releases/tag/v3.3.0 )
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ plugins {
29
29
id(" com.github.gmazzo.buildconfig" ) version " 4.1.2" apply false
30
30
id(" io.gitlab.arturbosch.detekt" )
31
31
id(" simbot.nexus-publish" )
32
+ id(" simbot.changelog-generator" )
32
33
}
33
34
34
35
setup(P .Simbot )
Original file line number Diff line number Diff line change @@ -160,6 +160,15 @@ fun Project.generateChangelog(tag: String) {
160
160
161
161
FileWriter (rootChangelogFile).buffered().use { writer ->
162
162
writer.appendLine(" # $tag " )
163
+ if (" -dev" in tag) {
164
+ writer.appendLine(
165
+ """
166
+ > [!warning]
167
+ > 这是一个尚在开发中的**预览版**,它可能不稳定,可能会频繁变更,且没有可用性保证。
168
+
169
+ """ .trimIndent()
170
+ )
171
+ }
163
172
writer.appendLine(
164
173
"""
165
174
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ package love.forte.simbot.event
28
28
import kotlinx.coroutines.CoroutineScope
29
29
import kotlinx.coroutines.Job
30
30
import kotlinx.coroutines.flow.*
31
+ import kotlinx.coroutines.launch
31
32
import kotlin.jvm.JvmMultifileClass
32
33
import kotlin.jvm.JvmName
33
34
import kotlin.jvm.JvmSynthetic
@@ -179,6 +180,32 @@ public interface EventProcessor {
179
180
}
180
181
181
182
183
+ /* *
184
+ * 将事件推送并异步处理。
185
+ */
186
+ @JvmSynthetic
187
+ public fun EventProcessor.pushAndLaunch (
188
+ scope : CoroutineScope ,
189
+ event : Event ,
190
+ collector : FlowCollector <EventResult >? = null,
191
+ ): Job = scope.launch {
192
+ with (push(event)) {
193
+ if (collector != null ) collect(collector) else collect()
194
+ }
195
+ }
196
+
197
+ /* *
198
+ * 将事件推送并异步处理。
199
+ */
200
+ @JvmSynthetic
201
+ public inline fun EventProcessor.pushAndLaunchThen (
202
+ scope : CoroutineScope ,
203
+ event : Event ,
204
+ crossinline useFlow : (Flow <EventResult >) -> Unit
205
+ ): Job = scope.launch {
206
+ useFlow(push(event))
207
+ }
208
+
182
209
/* *
183
210
* 将事件推送并收集处理。
184
211
*/
Original file line number Diff line number Diff line change 23
23
24
24
package love.forte.simbot.suspendrunner
25
25
26
- import kotlinx.coroutines.DelicateCoroutinesApi
27
- import kotlinx.coroutines.GlobalScope
26
+ import kotlinx.coroutines.Dispatchers
28
27
import kotlinx.coroutines.delay
28
+ import kotlinx.coroutines.test.runTest
29
29
import love.forte.simbot.annotations.InternalSimbotAPI
30
30
import love.forte.simbot.suspendrunner.reserve.mono
31
31
import love.forte.simbot.suspendrunner.reserve.suspendReserve
32
32
import reactor.test.StepVerifier
33
- import kotlin.coroutines.EmptyCoroutineContext
34
33
import kotlin.test.Test
35
34
36
35
@@ -40,10 +39,10 @@ import kotlin.test.Test
40
39
*/
41
40
class JvmReserveTests {
42
41
43
- @OptIn(InternalSimbotAPI ::class , DelicateCoroutinesApi :: class )
42
+ @OptIn(InternalSimbotAPI ::class )
44
43
@Test
45
- fun jvmReserveMonoTest () {
46
- val reserve = suspendReserve(GlobalScope , EmptyCoroutineContext ) { run () }
44
+ fun jvmReserveMonoTest () = runTest {
45
+ val reserve = suspendReserve(this , Dispatchers . Default ) { run () }
47
46
val mono = reserve.transform(mono())
48
47
49
48
StepVerifier .create(mono)
You can’t perform that action at this time.
0 commit comments