MCPcopy Create free account
hub / github.com/Tencent/phxqueue / MakeGetRequest

Method MakeGetRequest

phxqueue/consumer/consumer.cpp:540–555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

538
539
540void Consumer::MakeGetRequest(const comm::proto::ConsumerContext &cc, const config::proto::QueueInfo &queue_info, const int limit, comm::proto::GetRequest &req) {
541 req.set_topic_id(impl_->topic_id);
542 req.set_store_id(cc.store_id());
543 req.set_queue_id(cc.queue_id());
544 req.set_limit(limit);
545 if (queue_info.delay() > 0) {
546 auto now = comm::utils::Time::GetTimestampMS();
547 req.set_atime(now / 1000 - queue_info.delay());
548 req.set_atime_ms(now % 1000);
549 }
550 req.set_sub_id(cc.sub_id());
551
552 req.set_prev_cursor_id(cc.prev_cursor_id());
553 req.set_next_cursor_id(cc.next_cursor_id());
554
555}
556
557void Consumer::UpdateConsumerContextByGetResponse(const comm::proto::GetResponse &resp, comm::proto::ConsumerContext &cc) {
558 QLVerb("cc: sub_id %d store_id %d queue_id %d prev_cursor_id (%" PRIu64 "->%" PRIu64 ") next_cursor_id (%" PRIu64 "->%" PRIu64,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected