/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Pass a true value in order to distinguish this event reception // from any manual destroy caused by the frontend this.on( "descriptor-destroyed", this.destroy.bind(this, { isServerDestroyEvent: true })
);
}
get client() { returnthis._client;
}
async destroy({ isServerDestroyEvent } = {}) { if (this.isDestroyed()) { return;
} // This workaround is mostly done for Workers, as WorkerDescriptor // extends the Target class, which causes some issue down the road: // In Target.destroy, we call WorkerDescriptorActor.detach *before* calling super.destroy(), // and so hold on before calling Front.destroy() which would reject all pending requests, including detach(). // When calling detach, the server will emit "descriptor-destroyed", which will call Target.destroy again, // but will still be blocked on detach resolution and won't call Front.destroy, and won't reject pending requests either. // // So call Front.baseFrontClassDestroyed manually from here, so that we ensure rejecting the pending detach request // and unblock Target.destroy resolution. // // Here is the inheritance chain for WorkerDescriptor: // WorkerDescriptor -> Descriptor (from descriptor-mixin.js) -> Target (from target-mixin.js) -> Front (protocol.js) -> Pool (protocol.js) -> EventEmitter if (isServerDestroyEvent) { this.baseFrontClassDestroy();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.