Skip to content

Commit

Permalink
Merge pull request #372 from parisiale/PCP-344
Browse files Browse the repository at this point in the history
(PCP-344) Rely on cpp-pcp-client's ttl_expired callback
  • Loading branch information
mruzicka committed Mar 29, 2016
2 parents 47b5d5e + 8976461 commit 841a2c8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
4 changes: 0 additions & 4 deletions lib/inc/pxp-agent/agent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ class Agent {
// will send a PXP non-blocking response containing the action
// outcome when finished.
void nonBlockingRequestCallback(const PCPClient::ParsedChunks& parsed_chunks);

// Callback for PCPClient::Connector handling incoming PCP TTL
// Expired messages; it will only log the ID of the expired msg.
void ttlExpiredCallback(const PCPClient::ParsedChunks& parsed_chunks);
};

} // namespace PXPAgent
Expand Down
11 changes: 0 additions & 11 deletions lib/src/agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ void Agent::start() {
nonBlockingRequestCallback(parsed_chunks);
});

connector_ptr_->registerMessageCallback(
PCPClient::Protocol::TTLExpiredSchema(),
[this](const PCPClient::ParsedChunks& parsed_chunks) {
ttlExpiredCallback(parsed_chunks);
});

int num_seconds {};
std::random_device rd {};
std::default_random_engine engine { rd() };
Expand Down Expand Up @@ -99,9 +93,4 @@ void Agent::nonBlockingRequestCallback(const PCPClient::ParsedChunks& parsed_chu
request_processor_.processRequest(RequestType::NonBlocking, parsed_chunks);
}

void Agent::ttlExpiredCallback(const PCPClient::ParsedChunks& parsed_chunks) {
LOG_WARNING("Received TTL expired message - expired message ID: %1%",
parsed_chunks.data.get<std::string>("id"));
}

} // namespace PXPAgent

0 comments on commit 841a2c8

Please sign in to comment.