add set_compression to dispatcher

This commit is contained in:
əlemi 2022-05-23 01:09:01 +02:00
parent 530ff373a0
commit 70e89fc4a9
No known key found for this signature in database
GPG key ID: BBCBFE5D7244634E

View file

@ -148,6 +148,10 @@ class Dispatcher:
self._packet_id_whitelist = set((P(self._proto).id for P in self._packet_whitelist)) self._packet_id_whitelist = set((P(self._proto).id for P in self._packet_whitelist))
return self return self
def set_compression(self, threshold:Optional[int] = None) -> 'Dispatcher':
self._compression = threshold
return self
def set_state(self, state:Optional[ConnectionState]=ConnectionState.HANDSHAKING) -> 'Dispatcher': def set_state(self, state:Optional[ConnectionState]=ConnectionState.HANDSHAKING) -> 'Dispatcher':
self.state = state or self.state self.state = state or self.state
return self return self