File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
- export class TopicPartitionSession {
1
+ import { EventEmitter } from "node:stream"
2
+
3
+ type TopicPartitionSessionEmitterMap = {
4
+ "stop" : [ ]
5
+ "end" : [ ]
6
+ }
7
+
8
+ export class TopicPartitionSession extends EventEmitter < TopicPartitionSessionEmitterMap > {
2
9
/**
3
10
* Partition session identifier.
4
11
*/
@@ -35,6 +42,8 @@ export class TopicPartitionSession {
35
42
* @param topicPath - The path of the topic.
36
43
*/
37
44
constructor ( partitionSessionId : bigint , partitionId : bigint , topicPath : string ) {
45
+ super ( ) ;
46
+
38
47
this . partitionSessionId = partitionSessionId ;
39
48
this . partitionId = partitionId ;
40
49
this . topicPath = topicPath ;
@@ -49,10 +58,12 @@ export class TopicPartitionSession {
49
58
}
50
59
51
60
stop ( ) : void {
61
+ this . emit ( "stop" ) ;
52
62
this . #stopped = true ;
53
63
}
54
64
55
65
end ( ) : void {
66
+ this . emit ( "end" ) ;
56
67
this . #ended = true ;
57
68
}
58
69
}
You can’t perform that action at this time.
0 commit comments