(self, server, params, handler)
| 81 | """ |
| 82 | |
| 83 | def __init__(self, server, params, handler): |
| 84 | self.logger = logging.getLogger(__name__) |
| 85 | self.server = server |
| 86 | self._client_handle = 200 |
| 87 | self._handler = handler |
| 88 | self.parameters = params # move to data class |
| 89 | self._monitoreditems_map = {} |
| 90 | self._lock = Lock() |
| 91 | self.subscription_id = None |
| 92 | self.has_unknown_handlers = False |
| 93 | response = self.server.create_subscription( |
| 94 | params, self.publish_callback, ready_callback=self.ready_callback) |
| 95 | # Set it here to keep the old behavof as well, but this may not run if |
| 96 | # the above times out |
| 97 | self.subscription_id = response.SubscriptionId |
| 98 | |
| 99 | #Send a publish request so the server has one in its queue |
| 100 | # Servers should alsways be able to handle at least on extra publish request per subscriptions |
| 101 | self.server.publish() |
| 102 | |
| 103 | def delete(self): |
| 104 | """ |
nothing calls this directly
no test coverage detected