##// END OF EJS Templates
unregister and register both take comm as argument
Sylvain Corlay -
Show More
@@ -72,10 +72,10 b' class CommManager(LoggingConfigurable):'
72 self.comms[comm_id] = comm
72 self.comms[comm_id] = comm
73 return comm_id
73 return comm_id
74
74
75 def unregister_comm(self, comm_id):
75 def unregister_comm(self, comm):
76 """Unregister a comm, and close its counterpart"""
76 """Unregister a comm, and close its counterpart"""
77 # unlike get_comm, this should raise a KeyError
77 # unlike get_comm, this should raise a KeyError
78 comm = self.comms.pop(comm_id)
78 comm = self.comms.pop(comm.comm_id)
79
79
80 def get_comm(self, comm_id):
80 def get_comm(self, comm_id):
81 """Get a comm with a particular id
81 """Get a comm with a particular id
@@ -115,7 +115,7 b' class CommManager(LoggingConfigurable):'
115 except Exception:
115 except Exception:
116 self.log.error("Exception opening comm with target: %s", target_name, exc_info=True)
116 self.log.error("Exception opening comm with target: %s", target_name, exc_info=True)
117 comm.close()
117 comm.close()
118 self.unregister_comm(comm_id)
118 self.unregister_comm(comm)
119
119
120 def comm_msg(self, stream, ident, msg):
120 def comm_msg(self, stream, ident, msg):
121 """Handler for comm_msg messages"""
121 """Handler for comm_msg messages"""
General Comments 0
You need to be logged in to leave comments. Login now