Blocker in the Reader.
Closed this issue · 7 comments
Each reader has a blocker which has a message list inside. Why use a list if when publish a message push in front and when observe take the message in front?
It is a queue and not a list, What do you mean by list
apollo/cyber/blocker/blocker.h
Lines 107 to 110 in 11104c3
What policy is adopted in this queue?
it's a queue, without any priority.
I think there is no way to control the priority of the message for now, only the priority of the coroutine?
What policy is adopted in this queue?
NO policy, just FIFO.
Ok, but I have a question. For example in the code below, in the function called at line 282 happens observed_msg_queue_ = published_msg_queue_;
and in the function called at the line 283
if (observed_msg_queue_.empty()) {
return dummy_msg_;
}
return *observed_msg_queue_.front();
Why I take the element in front of the queue and not in the back?
apollo/modules/control/control_component.cc
Lines 279 to 290 in 55fe6da
I was wrong before, this is indeed a list
.
using MessageQueue = std::list<MessagePtr>;
I search the method, seems all the modules just used GetLatestObserved
. Then only one size buffer is enough, if we don't need old messages.
Messages will put in front of the list, and when the buffer is full, it will pop at the back. So the latest message will always in the front.
Closed due to inactivity. If the problem persists, pls feel free to reopen it or create a new one and refer to it.