Skip to content

[WIP] Refactor, stage 2#113

Closed
SwooshyCueb wants to merge 1 commit intoirods:mainfrom
SwooshyCueb:refactor.main
Closed

[WIP] Refactor, stage 2#113
SwooshyCueb wants to merge 1 commit intoirods:mainfrom
SwooshyCueb:refactor.main

Conversation

@SwooshyCueb
Copy link
Copy Markdown
Member

Creating a draft PR now since I'm switching gears for a bit.

This is the PR for stage 2 of the refactor started by #105. This stage of the refactor will introduce a dedicated thread for the AMQP message sender and the ability to handle multiple AMQP endpoints.

Copy link
Copy Markdown
Contributor

@alanking alanking left a comment

Choose a reason for hiding this comment

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

Lookin real nice so far

Comment on lines +29 to +35
#ifdef __cpp_lib_filesystem
#include <filesystem>
namespace fs = std::filesystem;
#else
#include <boost/filesystem.hpp>
namespace fs = boost::filesystem;
#endif
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just curious: Is this feature check for purposes of portability?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Okay. It made me wonder to what extent we wanted to do things like this. For instance, if this is to support older compilers, do we need to do something similar for, i.e. string_view (>=C++17)? I don't have a problem with this one, was just wondering where we're drawing this particular line, and/or if I missed the point. :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's less about the compiler and more about the stdlib. If you think it's unlikely that someone would compile against a stdlib that would have string_view and not std::filesystem I can remove this

{
public:
amqp_endpoint(
const std::string_view& _scheme,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any reason these std::string_views are refs?

Comment thread src/amqp_sender.cpp
namespace
{
BOOST_FORCEINLINE std::string build_amqp_url(
const std::string_view& _scheme,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we be using refs with std::string_view?

Comment thread src/main.cpp
{"rule_engine_plugin", rule_engine_name},
{"instance_name", _instance_name},
{"log_message", "Ignoring amqp_location and amqp_topic in favor of amqp_endpoints. These "
"settings have been deprecated and should be removed from the plugin ."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is the '.' at the end of this line of text intentional?

@SwooshyCueb
Copy link
Copy Markdown
Member Author

Closing in favor of #185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants