Skip to content

Conversation

denniswittich
Copy link
Contributor

Motivation

In some projects we found the lazy worker to be problematic and prefer to implement the lazyness in the application code.

There was also a reconnection bug where the rosys-detector module tries to reconnect while the detector still thinks the connection is established. Problem occured when auto_disconnect is False and the detector container is stopped and restarted while the rosys container keeps running. This seems to be solved by explicitly calling disconnect before reconnecting.

Implementation

  • make use of lazy worker optional
  • enforce disconnect call after failed connection attempt

- enforce disconnect call  after failed connection attempt
@denniswittich denniswittich added this to the 0.30.0 milestone Oct 15, 2025
ftilde
ftilde previously approved these changes Oct 16, 2025
Copy link
Contributor

@falkoschindler falkoschindler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some thoughts about the event handling:

  • I suggest to name the event handling callback using the imperative "handle_..." instead of "on_...". This way you can write, e.g., button.on_click(handle_click) which reads quite naturally.
  • We shouldn't introduce new public methods that are only used internally. So the new event handlers should be marked as private.
  • Instead of creating new methods we can keep using nested functions and only replace the decorators with the "method way" (which is actually not a method but a function).
  • We can skip everything above and simply use lambda expressions. 😄

@denniswittich denniswittich merged commit 480d672 into main Oct 17, 2025
5 checks passed
@denniswittich denniswittich deleted the detector-tweaks branch October 17, 2025 10:42
@pascalzauberzeug pascalzauberzeug added the enhancement New feature or request label Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants