# API change request for xQueueReceive() to drop an entry

**URL:** <https://forums.freertos.org/t/api-change-request-for-xqueuereceive-to-drop-an-entry/18516>\
**Category:** Kernel\
**Created:** [November 16, 2023, 5:30am UTC](https://forums.freertos.org/t/api-change-request-for-xqueuereceive-to-drop-an-entry/18516 "2023-11-16T05:30:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmcqueen](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@cmcqueen](https://forums.freertos.org/u/cmcqueen)\
**Post date:** [November 16, 2023, 5:30am UTC](https://forums.freertos.org/t/api-change-request-for-xqueuereceive-to-drop-an-entry/18516/1 "2023-11-16T05:30:37Z")

</div>

I have used a programming idiom where I want to `xQueuePeek()` a message queue, and attempt to send the message. If the send succeeds, then I want to drop the message from the queue. At the moment, the only way to drop the message from the queue is to call `xQueueReceive()`, with a non-NULL value for `pvBuffer`.

It would be good if `xQueueReceive()` would accept a `NULL` value for `pvBuffer`, allowing it to drop the next entry in the queue without the overhead of copying it to a buffer.

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [November 17, 2023, 5:39am UTC](https://forums.freertos.org/t/api-change-request-for-xqueuereceive-to-drop-an-entry/18516/2 "2023-11-17T05:39:38Z")

</div>

> [@cmcqueen](#):
>
> If the send succeeds, then I want to drop the message from the queue.

What is the more likely path? If the send succeds more often, can you do xQueueReceive and do xQueueSend/xQueueSendToFront when send fails?
