Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Device.pubsub_* helpers into proper decorators #550

Open
alexdewar opened this issue Apr 11, 2024 · 0 comments
Open

Make Device.pubsub_* helpers into proper decorators #550

alexdewar opened this issue Apr 11, 2024 · 0 comments
Labels
could_have Specified as "could have" in the project proposal

Comments

@alexdewar
Copy link
Collaborator

At some point, these helpers lived outside the Device class and functioned as normal decorators. Now the way they're used is a bit strange, e.g.:

        self._requester.make_request(
            f"http://{OPUS_IP}/opusrs/{filename}",
            self.pubsub_errors(self._on_reply_received),
        )

Despite what I clearly believed in the past, it is possible to have decorators which operate correctly on member functions: https://stackoverflow.com/questions/11731136/class-method-decorator-with-self-arguments

It would be much cleaner if member functions could just be decorated with pubsub_errors and pubsub_broadcast directly.

@alexdewar alexdewar self-assigned this Apr 11, 2024
@alexdewar alexdewar added the could_have Specified as "could have" in the project proposal label Oct 11, 2024
@alexdewar alexdewar removed their assignment Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
could_have Specified as "could have" in the project proposal
Projects
None yet
Development

No branches or pull requests

1 participant