Updated waitResponse
This commit is contained in:
parent
60383a502c
commit
70bef36f64
|
|
@ -36,22 +36,24 @@ void etcdv3::AsyncWatchAction::waitForResponse()
|
||||||
{
|
{
|
||||||
void* got_tag;
|
void* got_tag;
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
|
|
||||||
while(cq_.Next(&got_tag, &ok))
|
while(cq_.Next(&got_tag, &ok))
|
||||||
{
|
{
|
||||||
|
if(ok == false || (got_tag == (void*)"writes done"))
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
if(got_tag == (void*)this) // read tag
|
if(got_tag == (void*)this) // read tag
|
||||||
{
|
{
|
||||||
if(reply.events_size())
|
if(reply.events_size())
|
||||||
{
|
{
|
||||||
stream->WritesDone((void*)this);
|
stream->WritesDone((void*)"writes done");
|
||||||
cq_.Next(&got_tag, &ok);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stream->Read(&reply, (void*)this);
|
stream->Read(&reply, (void*)this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue