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

Method hello

lib_acl_cpp/src/disque/disque.cpp:457–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

455}
456
457const std::vector<disque_node*>* disque::hello()
458{
459 free_nodes();
460
461 size_t argc = 1;
462 const char* argv[1];
463 size_t lens[1];
464
465 argv[0] = "HELLO";
466 lens[0] = sizeof("HELLO") - 1;
467
468 build_request(argc, argv, lens);
469 const redis_result* rr = run();
470 if (rr == NULL) {
471 return NULL;
472 }
473
474 size_t n;
475 const redis_result** children = rr->get_children(&n);
476 if (children == NULL || n < 3) {
477 return NULL;
478 }
479
480 if (children[0]->get_type() == REDIS_RESULT_INTEGER) {
481 version_ = children[0]->get_integer();
482 }
483
484 if (children[1]->get_type() == REDIS_RESULT_STRING) {
485 children[1]->argv_to_string(myid_);
486 }
487
488 for (size_t i = 2; i < n; i++) {
489 disque_node* node = create_node(children[i]);
490 if (node != NULL) {
491 nodes_.push_back(node);
492 }
493 }
494 return &nodes_;
495}
496
497disque_node* disque::create_node(const redis_result* rr)
498{

Callers 1

test_helloFunction · 0.80

Calls 8

build_requestFunction · 0.50
runFunction · 0.50
create_nodeFunction · 0.50
get_childrenMethod · 0.45
get_typeMethod · 0.45
get_integerMethod · 0.45
argv_to_stringMethod · 0.45
push_backMethod · 0.45

Tested by 1

test_helloFunction · 0.64