-
Notifications
You must be signed in to change notification settings - Fork 32
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
Event handling for active alarms #121
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0508224
add PyCharm project files to .gitignore
chrisveilleux 3855063
add message bus events to handle queries regarding active alarms and …
chrisveilleux 7d1eadc
Added docstring to new method.
chrisveilleux dac1fad
Added some comments to address concerns raised in code review.
chrisveilleux 94cc92d
Added a message type to a message that was mistakenly removed.
chrisveilleux 7e85b47
changed message to use response mechanism
chrisveilleux File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
*.pyc | ||
settings.json | ||
mycroft | ||
mycroft | ||
|
||
# Pycharm project files | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be a
message.response
rather than a new Message?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the definition of "active alarm"? Any alarm at all (like for next week, or next year)? Or just in the next 24 hrs? Or just until midnight tonight? I don't care what the answer is... just that it's well-defined and documented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krisgesling I am purposefully trying to avoid the request/response mechanism. in my reading on event driven architecture, the proper way to respond to a command or request is to emit an event indicating the task was completed.
Are we an event driven architecture or a request/response architecture? I don't think we should be both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MetaGamer The current definition is whether or not any alarms exists that have not expired. I will add more information in the docstring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, the HiveMind spec, which is a kind of superset of the current Mycroft stack, splits the difference by emitting a response containing
ACK INSTRUCTION
(doesn't translate directly, because
INSTRUCTION
is an index, but it accomplishes cleanliness while preserving the two-way bus)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just gonna leave this here https://github.com/JarbasHiveMind/HiveMind-core/wiki/Mycroft-Messages
the reply/forward methods are essential for hivemind support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand and agree that
wait_for_response()
is not useful in this scenario (as far as I understand the use case) the using.response()
may still be of use so that messages follows a standardized format and indicates it's relation in a clear way. if the event emitted is only sent as a response (and not unprovoked due to other actions)I do think
wait_for_response()
has a niche to make the logic flow easier to follow when execution is blocked until an event is sent is a result of a triggering event.