dispose method
Disposes of resources associated with this Hako instance.
This method provides a hook for subclasses to override and perform cleanup operations when the Hako instance is being disposed. The default implementation just closes the event stream when open to stop emitting events.
Subclasses should call super.dispose() when overriding this method
to ensure proper cleanup of base resources. The actual lifecycle
management and when this method is called depends on the concrete
implementation.
Implementation
@mustCallSuper
void dispose() {
closeEventStream();
}