bitfinexcom / bitfinex-api-py

Apache License 2.0
200 stars 125 forks source link

New pyee version #221

Closed AhmetKadayfc closed 1 year ago

AhmetKadayfc commented 1 year ago

Issue type

Brief description

Performance issue of outdated pyee package.

Steps to reproduce

Old version:

def _remove_listener(self, event: str, f: Callable) -> None:
        """Naked unprotected removal."""
        self._events[event].pop(f)

In the above function, the _events[event] dictionary is emptied, but the event itself is not deleted from the _events dictionary. Consequently, in socket applications, the _events dictionary can swell up over time.

New version:

def _remove_listener(self, event: str, f: Callable) -> None:
        """Naked unprotected removal."""
        self._events[event].pop(f)
        if not len(self._events[event]):
            del self._events[event]

docs: https://pyee.readthedocs.io/en/latest/_modules/pyee/base.html#EventEmitter.remove_listener

The latest version of Pyee has resolved this issue. However, I am unable to utilize the new version due to the package requirements of bitfinex-api-py, which requires pyee~=8.0. Could you please update the requirements to include the new version?