How to clear the queue in publisher? #2355
-
I use publisher.loan( 1000 ).and_then([&](auto& userPayload) { .... }; to publish quickly, so there maybe lots of memory blocks in the publish queue. Sometimes, I need to clear the whole publish queue, and restart to loan again. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 8 replies
-
@jerry-xie-000 The publisher has a queue for the history and every subscriber has a buffer/queue. I am unsure what kind of publish queue you mean? |
Beta Was this translation helpful? Give feedback.
-
I make a mistake, maybe is not about the publisher or subscriber queue. I try to describe the workflow below:
Is there any method to clear all the data in the Mempool? |
Beta Was this translation helpful? Give feedback.
-
I remove the QueueFullPolicy::BLOCK_PRODUCER on the subscriber side. But if the subscriber sleep 2 seconds to do something, the publisher will print the below error every time:
iox_publisher_untyped.cpp:
iox_subscriber_untyped.cpp:
It seems not safe overflow when new data coming. |
Beta Was this translation helpful? Give feedback.
-
I would like to try the iceoryx2, but our platform is arm64. Do you have the install and compile guild for arm64? I try to compile, but the rust show some error. |
Beta Was this translation helpful? Give feedback.
-
OK, I post the issue for iceoryx2. Let's back to my example above, I require maybe 100 chunks of size |
Beta Was this translation helpful? Give feedback.
I set the subscriber queue by 10, and the errors gone.
I found the default value is
SubscriberChunkQueueData_t::MAX_CAPACITY
. It seems it will never overflow when full.Thank you.