Even though there is currently only a single event (output) that can be subscribed to on CommandRunner, there are two different methods for subscribing:
a generic subscribe_event method for registering handlers for events
a specific register_output_handler method for registering handlers for output events
Likewise, there are two different methods for notifying the handlers that an event has taken place:
a generic post_event method for events
a specific post_output method for output events
This PR unifies the treatment of output events and general events, i.e. output events are treated no differently than any other event. This makes the CommandRunner interface slimmer and more consistent but also allows for extensibility when additional event types might be added. Event handlers are still callables but now expect the event as their argument (carrying all necessary information to handle the event, e.g. the output, within the passed argument).
Resolved issues
This PR is not linked to a specific issue.
Documentation
No changes required to the documentation.
Web service API changes
No changes to the Web service API
Tests
All existing tests are still passing (following a couple of minor modifications to reflect the PR changes). No additional functionality has been added and hence no additional tests have been introduced.
Description
Even though there is currently only a single event (output) that can be subscribed to on
CommandRunner
, there are two different methods for subscribing:subscribe_event
method for registering handlers for eventsregister_output_handler
method for registering handlers for output eventsLikewise, there are two different methods for notifying the handlers that an event has taken place:
post_event
method for eventspost_output
method for output eventsThis PR unifies the treatment of output events and general events, i.e. output events are treated no differently than any other event. This makes the
CommandRunner
interface slimmer and more consistent but also allows for extensibility when additional event types might be added. Event handlers are still callables but now expect the event as their argument (carrying all necessary information to handle the event, e.g. the output, within the passed argument).Resolved issues
This PR is not linked to a specific issue.
Documentation
No changes required to the documentation.
Web service API changes
No changes to the Web service API
Tests
All existing tests are still passing (following a couple of minor modifications to reflect the PR changes). No additional functionality has been added and hence no additional tests have been introduced.