Skip to content

Commit da3c2ad

Browse files
committed
Clean up queue closing
1 parent ff79b6d commit da3c2ad

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

core/src/main/java/io/a2a/server/events/EventQueue.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ public void taskDone() {
8787
// TODO Not sure if needed yet. BlockingQueue.poll()/.take() remove the events.
8888
}
8989

90-
public void close() {
90+
public abstract void close();
91+
92+
public void doClose() {
9193
synchronized (this) {
9294
if (closed) {
9395
return;
@@ -138,8 +140,8 @@ void signalQueuePollerStarted() {
138140

139141
@Override
140142
public void close() {
141-
super.close();
142-
children.forEach(EventQueue::close);
143+
doClose();
144+
children.forEach(EventQueue::doClose);
143145
}
144146
}
145147

@@ -173,5 +175,10 @@ public void awaitQueuePollerStart() throws InterruptedException {
173175
void signalQueuePollerStarted() {
174176
parent.signalQueuePollerStarted();
175177
}
178+
179+
@Override
180+
public void close() {
181+
parent.close();
182+
}
176183
}
177184
}

0 commit comments

Comments
 (0)