Skip to content

Commit f35cf2f

Browse files
committed
refactor
1 parent b1ce17b commit f35cf2f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/main/kotlin/spp/cli/commands/instrument/SubscribeEvents.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,13 @@ import io.vertx.ext.eventbus.bridge.tcp.impl.protocol.FrameParser
3535
import io.vertx.kotlin.coroutines.await
3636
import kotlinx.coroutines.runBlocking
3737
import spp.cli.PlatformCLI
38+
import spp.protocol.ProtocolMarshaller.deserializeLiveInstrumentRemoved
3839
import spp.protocol.SourceServices
3940
import spp.protocol.extend.TCPServiceFrameParser
40-
import spp.protocol.instrument.event.*
41+
import spp.protocol.instrument.event.LiveBreakpointHit
42+
import spp.protocol.instrument.event.LiveInstrumentEvent
43+
import spp.protocol.instrument.event.LiveInstrumentEventType
44+
import spp.protocol.instrument.event.LiveLogHit
4145

4246
class SubscribeEvents : CliktCommand(
4347
help = "Listens for and outputs live events. Subscribes to all events by default"
@@ -103,7 +107,7 @@ class SubscribeEvents : CliktCommand(
103107
}
104108
}
105109
LiveInstrumentEventType.BREAKPOINT_REMOVED, LiveInstrumentEventType.LOG_REMOVED -> {
106-
val logRemoved = Json.decodeValue(liveEvent.data, LiveInstrumentRemoved::class.java)
110+
val logRemoved = deserializeLiveInstrumentRemoved(JsonObject(liveEvent.data))
107111
if (logRemoved.liveInstrument.id !in instrumentIds) {
108112
return@consumer
109113
}

0 commit comments

Comments
 (0)