unittest working / uses shared_ptr for a bunch of things 🗿

This commit is contained in:
Benjamin Sergeant
2019-06-05 15:18:19 -07:00
parent 9262880369
commit 3257ad1363
7 changed files with 330 additions and 111 deletions

View File

@ -99,7 +99,7 @@ namespace ix
void CobraMetricsThreadedPublisher::pushMessage(MessageKind messageKind,
const Json::Value& msg)
{
// Now actually enqueue the task
// Enqueue the task
{
// acquire lock
std::unique_lock<std::mutex> lock(_queue_mutex);

View File

@ -25,7 +25,6 @@ namespace ix
~CobraMetricsThreadedPublisher();
/// Configuration / set keys, etc...
/// All input data but the channel name is encrypted with rc4
void configure(const std::string& appkey,
const std::string& endpoint,
const std::string& channel,

View File

@ -46,9 +46,11 @@ namespace ix
std::condition_variable progressCondition;
std::queue<Json::Value> queue;
SentryClient sentryClient(dsn);
auto sentrySender = [&condition, &progressCondition, &conditionVariableMutex,
&queue, verbose, &errorSending, &sentCount,
&stop, &dsn]
&stop, &sentryClient]
{
while (true)
{
@ -62,9 +64,7 @@ namespace ix
queue.pop();
}
SentryClient sc(dsn);
if (!sc.send(msg, verbose))
if (!sentryClient.send(msg, verbose))
{
errorSending = true;
}