File tree Expand file tree Collapse file tree 7 files changed +7
-12
lines changed
infrastructure/digitaltwins Expand file tree Collapse file tree 7 files changed +7
-12
lines changed Original file line number Diff line number Diff line change 1
- import entities.events.Event
2
1
import application.presenter.EventConsumer
3
2
import application.presenter.EventPublisher
4
3
import application.services.EventService
4
+ import entities.events.Event
5
5
import infrastructure.kafka.KafkaPublisher
6
6
import infrastructure.signalr.SignalRClient
7
7
8
-
9
8
/*
10
9
* Copyright (c) 2023. Smart Operating Block
11
10
*
Original file line number Diff line number Diff line change @@ -21,5 +21,4 @@ interface EventPublisher<in E : Event<Any>> {
21
21
* @param event the event to publish.
22
22
*/
23
23
fun publishEvent (event : E )
24
-
25
24
}
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import application.presenter.EventPublisher
13
13
import entities.events.Event
14
14
import io.reactivex.rxjava3.core.BackpressureStrategy
15
15
import io.reactivex.rxjava3.core.Flowable
16
+ import io.reactivex.rxjava3.disposables.Disposable
16
17
17
18
/* *
18
19
* The Application service responsible to start the consumer and to propagate the events to the publisher.
@@ -25,12 +26,10 @@ class EventService<in C>(
25
26
/* *
26
27
* Start the event service.
27
28
*/
28
- fun start (){
29
+ fun start (): Disposable =
29
30
Flowable .create({ emitter ->
30
31
eventConsumer.start(emitter)
31
32
}, BackpressureStrategy .BUFFER ).subscribe { event ->
32
33
eventPublisher.publishEvent(event)
33
34
}
34
- }
35
-
36
35
}
Original file line number Diff line number Diff line change @@ -36,5 +36,4 @@ object EnvironmentData {
36
36
* @param presenceDetected true if is a person detection event, false otherwise.
37
37
*/
38
38
data class Presence (val presenceDetected : Boolean )
39
-
40
39
}
Original file line number Diff line number Diff line change @@ -22,4 +22,4 @@ data class ProcessEvent<E : Any>(
22
22
23
23
override val data : E ,
24
24
25
- ): Event<E>
25
+ ) : Event<E>
Original file line number Diff line number Diff line change @@ -24,5 +24,4 @@ object ProcessData {
24
24
* @param state the current state of the process.
25
25
*/
26
26
data class ProcessState (val state : String )
27
-
28
27
}
Original file line number Diff line number Diff line change @@ -44,12 +44,12 @@ object DTEvents {
44
44
* The patch section.
45
45
*/
46
46
val patch : List <Patch >,
47
- )
47
+ )
48
48
49
49
/* *
50
50
* The event of update of a DT.
51
51
*/
52
- data class UpdateTwinEvent (
52
+ data class UpdateTwinEvent (
53
53
/* *
54
54
* The data section of the event.
55
55
*/
@@ -74,5 +74,5 @@ object DTEvents {
74
74
* The date and time of the event.
75
75
*/
76
76
val eventDateTime : String ,
77
- )
77
+ )
78
78
}
You can’t perform that action at this time.
0 commit comments