Skip to content

Conversation

@rakesh-voiger
Copy link

@rakesh-voiger rakesh-voiger commented Apr 3, 2025

The lib always sets a Event-UUID in the SwitchX.execute method, which will make the command (application & arg) to run in the waiting mode (enqueues to applications_pending) where as it should have enqueued to commands_sent for instantly callback. The lib mistakenly looks for the callback in the commands_sent queue than in the applications_pending, hence it never ends waiting.

The change made in this PR will fix this behaviour by not setting Event-UUID inside the method, which leads to pushing the callback in the commands_sent queue correctly.

If caller indeed want's to wait for the command (application & arg) to complete, it can either set the Event-UUID explicitly or use a new method SwitchX.command. For the waiting mode, the SwitchX.my_events(data.conn) must be called first to subscribe to the command (application & arg) execution to complete and make the callback.

The name and split of execute and command is inspired by https://gitlab.com/shimaore/esl

Added comments for the execute without Event-UUID
@rakesh-voiger rakesh-voiger mentioned this pull request Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant