(self, msg)
| 131 | print("\n-- Socket Closed --") |
| 132 | |
| 133 | def on_message(self, msg): |
| 134 | if self.should_print: |
| 135 | print(msg) |
| 136 | if self.mongo_collection: # dump JSON to given mongo collection |
| 137 | self.mongo_collection.insert_one(msg) |
| 138 | |
| 139 | def on_error(self, e, data=None): |
| 140 | self.error = e |