##// END OF EJS Templates
comm_manager.comms correspond to the open comms.
Sylvain Corlay -
Show More
@@ -50,7 +50,6 b' class Comm(LoggingConfigurable):'
50 if target_name:
50 if target_name:
51 kwargs['target_name'] = target_name
51 kwargs['target_name'] = target_name
52 super(Comm, self).__init__(**kwargs)
52 super(Comm, self).__init__(**kwargs)
53 get_ipython().comm_manager.register_comm(self)
54 if self.primary:
53 if self.primary:
55 # I am primary, open my peer.
54 # I am primary, open my peer.
56 self.open(data)
55 self.open(data)
@@ -70,7 +69,6 b' class Comm(LoggingConfigurable):'
70 def __del__(self):
69 def __del__(self):
71 """trigger close on gc"""
70 """trigger close on gc"""
72 self.close()
71 self.close()
73 get_ipython().comm_manager.unregister_comm(self)
74
72
75 # publishing messages
73 # publishing messages
76
74
@@ -78,6 +76,8 b' class Comm(LoggingConfigurable):'
78 """Open the frontend-side version of this comm"""
76 """Open the frontend-side version of this comm"""
79 if data is None:
77 if data is None:
80 data = self._open_data
78 data = self._open_data
79 self._closed = False
80 get_ipython().comm_manager.register_comm(self)
81 self._publish_msg('comm_open', data, metadata, target_name=self.target_name)
81 self._publish_msg('comm_open', data, metadata, target_name=self.target_name)
82
82
83 def close(self, data=None, metadata=None):
83 def close(self, data=None, metadata=None):
@@ -88,6 +88,7 b' class Comm(LoggingConfigurable):'
88 if data is None:
88 if data is None:
89 data = self._close_data
89 data = self._close_data
90 self._publish_msg('comm_close', data, metadata)
90 self._publish_msg('comm_close', data, metadata)
91 get_ipython().comm_manager.unregister_comm(self)
91 self._closed = True
92 self._closed = True
92
93
93 def send(self, data=None, metadata=None):
94 def send(self, data=None, metadata=None):
General Comments 0
You need to be logged in to leave comments. Login now