Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit ee0d583

Browse files
committed
Fix #89: Clear all event handlers when shutting down an event input
1 parent ab8031d commit ee0d583

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/scala/org/codeoverflow/chatoverflow/requirement/impl/EventInputImpl.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,15 @@ abstract class EventInputImpl[T <: Event, C <: Connector](implicit ctc: ClassTag
3939
handlers.filter(handler => handler.clazz == cts.runtimeClass)
4040
.foreach(handler => handler.consumer.asInstanceOf[Consumer[S]].accept(event))
4141
}
42+
43+
override def shutdown(): Boolean = {
44+
if (sourceConnector.isDefined) {
45+
val stopped = stop()
46+
handlers.clear()
47+
stopped & sourceConnector.get.shutdown()
48+
} else {
49+
logger warn "Source connector not set."
50+
false
51+
}
52+
}
4253
}

0 commit comments

Comments
 (0)