---
title: "Comment by Akash Khunt on \"WhileSubscribed(5000)\" | Hashnode"
description: "Really neat solution 👏. I just didn&#39;t understood one thing here that why we need both postAtFrontOfQueue() &amp; post() ? Wouldn&#39;t just post() do the t"
url: "https://hashnode.com/posts/whilesubscribed5000/630e96e456df9e8e502575df/comment/6315ba47041b51e1712e7780"
---

[Discussion](https://hashnode.com/posts/whilesubscribed5000/630e96e456df9e8e502575df)

Comment [WhileSubscribed(5000)](https://hashnode.com/posts/whilesubscribed5000/630e96e456df9e8e502575df)

[Akash Khunt](https://hashnode.com/@bastionkid)

[Sep 5, 2022](https://hashnode.com/posts/whilesubscribed5000/630e96e456df9e8e502575df/comment/6315ba47041b51e1712e7780)

Really neat solution 👏.

I just didn't understood one thing here that why we need both **postAtFrontOfQueue()** & **post()**? Wouldn't just **post()** do the trick for us like shown below? 🤔 With or without **postAtFrontOfQueue()** we essentially want to call **posted.complete(Unit)** at the end of the main thread queue.

```
Choreographer.getInstance().postFrameCallback {
    handler.post {
        posted.complete(Unit)
    }
}
```
