MCPcopy Create free account
hub / github.com/acl-dev/acl / get_pending_message

Method get_pending_message

lib_acl_cpp/src/redis/redis_stream.cpp:1007–1050  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1005}
1006
1007bool redis_stream::get_pending_message(const redis_result& rr,
1008 redis_pending_message& message)
1009{
1010 if (rr.get_type() != REDIS_RESULT_ARRAY) {
1011 return false;
1012 }
1013
1014 size_t size;
1015 const redis_result** children = rr.get_children(&size);
1016 if (children == NULL || size < 4) {
1017 return false;
1018 }
1019
1020 const redis_result* child = children[0];
1021 if (child->get_type() != REDIS_RESULT_STRING) {
1022 return false;
1023 }
1024 child->argv_to_string(message.id);
1025
1026 child = children[1];
1027 if (child->get_type() != REDIS_RESULT_STRING) {
1028 return false;
1029 }
1030 child->argv_to_string(message.consumer);
1031
1032 child = children[2];
1033 if (child->get_type() != REDIS_RESULT_INTEGER) {
1034 return false;
1035 }
1036 bool success;
1037 long long n = child->get_integer64(&success);
1038 if (n < 0 || !success) {
1039 return false;
1040 }
1041 message.elapsed = (unsigned long long) n;
1042
1043 n = child->get_integer(&success);
1044 if (n < 0 || !success) {
1045 return false;
1046 }
1047 message.delivered = (size_t) n;
1048
1049 return true;
1050}
1051
1052//////////////////////////////////////////////////////////////////////////////
1053

Callers

nothing calls this directly

Calls 5

get_typeMethod · 0.45
get_childrenMethod · 0.45
argv_to_stringMethod · 0.45
get_integer64Method · 0.45
get_integerMethod · 0.45

Tested by

no test coverage detected