unlisten method
Implementation
AsyncReply<dynamic> unlisten(event) {
if (_destroyed) throw new Exception("Trying to access destroyed object");
if (_suspended) throw new Exception("Trying to access suspended object");
EventTemplate? et = event is EventTemplate
? event
: instance?.template.getEventTemplateByName(event);
if (et == null)
return AsyncReply().triggerError(new AsyncException(
ErrorType.Management, ExceptionCode.MethodNotFound.index, ""));
if (!et.listenable)
return AsyncReply().triggerError(new AsyncException(
ErrorType.Management, ExceptionCode.NotListenable.index, ""));
return connection?.sendUnlistenRequest(_instanceId as int, et.index)
as AsyncReply;
}