Show More
@@ -28,10 +28,15 b' class OutStream(object):' | |||
|
28 | 28 | self.name = name |
|
29 | 29 | self.parent_header = {} |
|
30 | 30 | self._new_buffer() |
|
31 | self.metadata = {} | |
|
31 | 32 | |
|
32 | 33 | def set_parent(self, parent): |
|
33 | 34 | self.parent_header = extract_header(parent) |
|
34 | 35 | |
|
36 | def set_metadata(self, metadata): | |
|
37 | self.flush() | |
|
38 | self.metadata = metadata | |
|
39 | ||
|
35 | 40 | def close(self): |
|
36 | 41 | self.pub_socket = None |
|
37 | 42 | |
@@ -43,6 +48,8 b' class OutStream(object):' | |||
|
43 | 48 | data = self._buffer.getvalue() |
|
44 | 49 | if data: |
|
45 | 50 | content = {u'name':self.name, u'data':data} |
|
51 | if self.metadata: | |
|
52 | content['metadata'] = self.metadata | |
|
46 | 53 | msg = self.session.send(self.pub_socket, u'stream', content=content, |
|
47 | 54 | parent=self.parent_header, ident=self.topic) |
|
48 | 55 |
General Comments 0
You need to be logged in to leave comments.
Login now