in src/Consumer.cc [130:143]
void Consumer::SetListenerCallback(MessageListenerCallback *listener) {
if (this->listener != nullptr) {
// It is only safe to set the listener once for the lifecycle of the Consumer
return;
}
if (listener != nullptr) {
listener->consumer = this;
// If a consumer listener is set, the Consumer instance is kept alive even if it goes out of scope in JS
// code.
this->Ref();
this->listener = listener;
}
}