mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-14 23:24:52 +09:00
Move responsibility of handling unsubscription on close
Notify the SubscriptionController that a connection closed from the Connection instead of having the subscription controller set up an event to do so. This simplifies the logic on the SubscriptionController's side.
This commit is contained in:
1 parent
0df672ecca
commit
1d729adbb7
3 files changed
+39
-17
No files matched your search
@@ -33,6 +33,10 @@ export default class BaseConnection extends lib.Link {
|
||||
this.handle(lib.ModPackGetRequest, this.handleModPackGetRequest.bind(this));
|
||||
this.handle(lib.ModPackGetDefaultRequest, this.handleModPackGetDefaultRequest.bind(this));
|
||||
this.handle(lib.ModDownloadRequest, this.handleModDownloadRequest.bind(this));
|
||||
|
||||
this.connector.on("close", () => {
|
||||
this._controller.subscriptions.unsubscribe(this);
|
||||
});
|
||||
}
|
||||
|
||||
async disconnect(code: number, reason: string) {
|
||||
|
||||
Reference in new issue
Block a user