Skip to content

Commit 7343d5a

Browse files
refactor: refactor code for respect style conventions
1 parent 7a49c0e commit 7343d5a

File tree

7 files changed

+7
-12
lines changed

7 files changed

+7
-12
lines changed

src/main/kotlin/App.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import entities.events.Event
21
import application.presenter.EventConsumer
32
import application.presenter.EventPublisher
43
import application.services.EventService
4+
import entities.events.Event
55
import infrastructure.kafka.KafkaPublisher
66
import infrastructure.signalr.SignalRClient
77

8-
98
/*
109
* Copyright (c) 2023. Smart Operating Block
1110
*

src/main/kotlin/application/presenter/EventPublisher.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ interface EventPublisher<in E : Event<Any>> {
2121
* @param event the event to publish.
2222
*/
2323
fun publishEvent(event: E)
24-
2524
}

src/main/kotlin/application/services/EventService.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import application.presenter.EventPublisher
1313
import entities.events.Event
1414
import io.reactivex.rxjava3.core.BackpressureStrategy
1515
import io.reactivex.rxjava3.core.Flowable
16+
import io.reactivex.rxjava3.disposables.Disposable
1617

1718
/**
1819
* The Application service responsible to start the consumer and to propagate the events to the publisher.
@@ -25,12 +26,10 @@ class EventService<in C>(
2526
/**
2627
* Start the event service.
2728
*/
28-
fun start(){
29+
fun start(): Disposable =
2930
Flowable.create({ emitter ->
3031
eventConsumer.start(emitter)
3132
}, BackpressureStrategy.BUFFER).subscribe { event ->
3233
eventPublisher.publishEvent(event)
3334
}
34-
}
35-
3635
}

src/main/kotlin/entities/environment/EnvironmentData.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,4 @@ object EnvironmentData {
3636
* @param presenceDetected true if is a person detection event, false otherwise.
3737
*/
3838
data class Presence(val presenceDetected: Boolean)
39-
4039
}

src/main/kotlin/entities/events/ProcessEvent.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ data class ProcessEvent<E : Any>(
2222

2323
override val data: E,
2424

25-
): Event<E>
25+
) : Event<E>

src/main/kotlin/entities/process/ProcessData.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,4 @@ object ProcessData {
2424
* @param state the current state of the process.
2525
*/
2626
data class ProcessState(val state: String)
27-
2827
}

src/main/kotlin/infrastructure/digitaltwins/DTEvents.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ object DTEvents {
4444
* The patch section.
4545
*/
4646
val patch: List<Patch>,
47-
)
47+
)
4848

4949
/**
5050
* The event of update of a DT.
5151
*/
52-
data class UpdateTwinEvent(
52+
data class UpdateTwinEvent(
5353
/**
5454
* The data section of the event.
5555
*/
@@ -74,5 +74,5 @@ object DTEvents {
7474
* The date and time of the event.
7575
*/
7676
val eventDateTime: String,
77-
)
77+
)
7878
}

0 commit comments

Comments
 (0)