-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat: include message id in emitted worker events #115
feat: include message id in emitted worker events #115
Conversation
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.
LGTM
0db1a61
to
cd3f6a0
Compare
What is the difference between this |
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.
This requires a change to the com.redhat.Yggdrasil1.Worker1
D-Bus interface definition too. That specification defines the fields that can be included in the Event
signal, and adding a field such as this requires updating the D-Bus specification as well.
This is a signal emitted by the worker; it is not intended to be a means by which a worker can "respond" to messages. It's more like the worker saying "okay, I got the message 1234" rather than "here is message 5678 in reply to message 1234". |
825bcce
to
a2b0c06
Compare
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.
This looks great. I just have one small nit-picky thing about function parameter order.
worker/worker.go
Outdated
func (w *Worker) EmitEvent(event ipc.WorkerEventName, message string) error { | ||
args := []interface{}{event} | ||
// EmitEvent emits a WorkerEvent, worker message id, and an optional message. | ||
func (w *Worker) EmitEvent(event ipc.WorkerEventName, message string, message_id string) error { |
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.
Could we keep the order of arguments the same as the arguments of the D-Bus method? That reduces cognitive friction when translating between the D-Bus interface description and the implementations.
Signed-off-by: Jason Jerome <jajerome@redhat.com>
This patch also updates the "listen" yggctl action and "WorkerEvent" dbus signals to include new message ids. Signed-off-by: Jason Jerome <jajerome@redhat.com>
72aa12b
to
034eb24
Compare
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 noticed a couple more small changes. One is a typo and one is a variable naming convention. Once those are fixed, I'll merge this. I tested it locally already, so it functions as expected.
Signed-off-by: Jason Jerome <jajerome@redhat.com>
The purpose of this update is to prepare for the implementation of a
message journal in yggdrasil by making small changes to workers.
This change adds the worker's message id to the emitted event data in addition
to the currently existing ipc worker event name and worker message data.
Current:
...EmitEvent(worker_event_name, worker_event_message)
Proposed:
...EmitEvent(worker_event_name, worker_event_message, worker_message_id)
Changes: