150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 | |
def send(self, item): |
"""sends the given item to the other side of the channel, |
possibly blocking if the sender queue is full. |
Note that an item needs to be marshallable. |
""" |
if self.isclosed(): |
raise IOError, "cannot send to %r" %(self,) |
if isinstance(item, Channel): |
data = Message.CHANNEL_NEW(self.id, item.id) |
else: |
data = Message.CHANNEL_DATA(self.id, item) |
self.gateway._send(data) | |