Skip to content
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

Implemented command and requestCommands methods in the FrameProcessor. #359

Merged
merged 2 commits into from
Oct 10, 2024

Conversation

ajgdls
Copy link
Contributor

@ajgdls ajgdls commented Sep 13, 2024

This PR adds the core code for supporting commands withinFrameProcessor plugins.
No commands are implemented within this PR.

Fixes #352

Copy link
Contributor

@timcnicholls timcnicholls left a comment

Choose a reason for hiding this comment

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

Thanks @ajgdls for doing this. I have a couple of comments/musings:

  • the new MsgVal enum entries should also be added to IpcMessage::msg_val_map_init() in IpcMessage.cpp to allow JSON encoding
  • in retrospect, now having a MsgType of MsgTypeCmd and a MsgVal of MsgValCmdCommand now looks a bit odd. We can't change MsgTypeCmd easily without breaking existing code, but I wonder if the naming of the new value could be tweaked to separate them a bit? Maybe something like MsgTypeCmdExecute? I'm not sure this is a huge issue, other than avoiding the need for a historical explanation 😉
  • at some point we should add enumeration of the types and values to IpcMessage in the python client...

@GDYendell
Copy link
Collaborator

Maybe something like MsgTypeCmdExecute?

👍

Copy link
Collaborator

@GDYendell GDYendell left a comment

Choose a reason for hiding this comment

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

Could you add a command the Dummy process plugin and then add a test the calls command() and request_commands()?

@ajgdls
Copy link
Contributor Author

ajgdls commented Sep 27, 2024

Hi @GDYendell @timcnicholls I have pushed the changes resulting from our conversation yesterday.

@ajgdls
Copy link
Contributor Author

ajgdls commented Oct 7, 2024

OK I think this is ready for review again. I have also tested sending commands with a python test client to a running FrameProcessor application.

@timcnicholls timcnicholls self-requested a review October 8, 2024 06:41
Copy link
Contributor

@timcnicholls timcnicholls left a comment

Choose a reason for hiding this comment

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

Looks good! Is EXECUTE_PRINT_NAME now redundant?

cpp/frameProcessor/include/DummyUDPProcessPlugin.h Outdated Show resolved Hide resolved
cpp/frameProcessor/src/DummyUDPProcessPlugin.cpp Outdated Show resolved Hide resolved
…e functionality.

Fixed runtime error in Dummy plugin and throw an exception if the supported
command is not requested when execution is called.

Added tests that use the Dummy plugin to test execute and requestCommands methods.

Update cpp/frameProcessor/test/DummyUDPProcessPluginTest.cpp

Co-authored-by: Gary Yendell <gary.yendell@diamond.ac.uk>

Added clarification comments.  Simplified boost test calls.

Updated to use string commands with no parameters.

Removed unused test code.

Removed unused execution parameter constant.
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.

Expose commands within the frameProcessor
3 participants