Skip to content

Conversation

@kinyoklion
Copy link
Member

No description provided.


client->run();
ioc.run();
Client client(ConfigBuilder(key).build().value(),
Copy link
Member Author

Choose a reason for hiding this comment

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

We have not implemented data source status or checks for initialization complete, so this just starts a thread and evaluates.

Copy link
Contributor

Choose a reason for hiding this comment

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

🤑


private:
std::shared_ptr<IDataSourceUpdateSink> handler_;
IDataSourceUpdateSink* handler_;
Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to a pointer now that the ownership of the sink is in the client.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to be a reference?

Copy link
Member Author

Choose a reason for hiding this comment

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

I am kind of curious if potentially we should change more of these items to be pointers. Clang tidy prefers it, but also it makes more clear when using them that they aren't values.

I am trying to see if the google style guide has any recommendations, it seems it maybe used to recommend pointers, but now doesn't seem to have either.

Anyway, going to defer for the moment.

logger_)) {
data_source_->Start();

// TODO: This isn't a long-term solution.
Copy link
Member Author

Choose a reason for hiding this comment

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

Need something to run tasks. This will work as a temporary approach. Just a thread chugging away at SDK tasks.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is made less crashy in: #26

Still not ideal.


bool Client::BoolVariation(Client::FlagKey const& key, bool default_value) {
Value Client::VariationInternal(FlagKey const& key, Value default_value) {
auto res = flag_manager_.Get(key);
Copy link
Member Author

Choose a reason for hiding this comment

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

Later this will need event sending.

@kinyoklion kinyoklion marked this pull request as ready for review April 19, 2023 16:31
@kinyoklion kinyoklion requested a review from cwaldren-ld April 19, 2023 16:31
#include "console_backend.hpp"
#include "context_builder.hpp"
#include "launchdarkly/client_side/api.hpp"
#include "launchdarkly/client_side/data_sources/detail/streaming_data_source.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

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

The duplicate header + formatting lint are probably worth doing

Copy link
Member Author

Choose a reason for hiding this comment

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

I deleted the headers, but my formatter doesn't seem to do anything.


client->run();
ioc.run();
Client client(ConfigBuilder(key).build().value(),
Copy link
Contributor

Choose a reason for hiding this comment

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

🤑


private:
std::shared_ptr<IDataSourceUpdateSink> handler_;
IDataSourceUpdateSink* handler_;
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to be a reference?

Value Client::VariationInternal(FlagKey const& key, Value default_value) {
auto res = flag_manager_.Get(key);
if (res && res->flag) {
return res->flag->detail().value();
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a plan for updating the .value() to not be unchecked (if that's an optional)

Copy link
Member Author

Choose a reason for hiding this comment

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

The value on detail is a Value.

The linter gets annoyed with if(res->flag){flag->detail()}... but if I put .value().detail() it would be happy. Even though that isn't more checking.

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.

4 participants