# PublishQuequeAsyncRK - WITH\_ACK issue - any solution?

**URL:** <https://community.particle.io/t/publishquequeasyncrk-with-ack-issue-any-solution/50721>\
**Category:** Libraries\
**Created:** [June 27, 2019, 12:52pm UTC](https://community.particle.io/t/publishquequeasyncrk-with-ack-issue-any-solution/50721 "2019-06-27T12:52:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![UMD](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/umd/32/5850_2.png) [@UMD](https://community.particle.io/u/UMD)\
**Post date:** [June 27, 2019, 12:52pm UTC](https://community.particle.io/t/publishquequeasyncrk-with-ack-issue-any-solution/50721/1 "2019-06-27T12:52:41Z")

</div>

@rickkas7’s excellent **PublishQuequeAsyncRK** library has a known issue when using Particle.publish() with the WITH\_ACK flag:

```auto
// For reasons that are not entirely obvious to me, you can't use WITH_ACK. If you specify it
// on the Photon or Electron, Particle.publish will immediately return false. This only happens
// with this code running in a separate thread. It works fine from the main thread.

```

This is an issue because I need the event to positively make it to the Particle cloud.

I can create a situation where the routine thinks it has sent it okay, but it does not make it because I have (purposely) turned off the data on my mobile hotspot.

This should be solved by using **WITH\_ACK** in the **Particle.publish()** call.

It looks like the work around is provided in the statement “works fine in the **main thread** ”.

Q1. How does one achieve that?

Q2. Any other suggestions on what I should try to get this library working with WITH\_ACK?

Q3. Does anyone know if there is a similar library that caches to **SD CARD** rather than/as well as, **retained memory**?

Thanks!

---

<div class="post-metadata">

**Author:** ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)\
**Post date:** [June 27, 2019, 1:00pm UTC](https://community.particle.io/t/publishquequeasyncrk-with-ack-issue-any-solution/50721/2 "2019-06-27T13:00:41Z")

</div>

Version 0.0.3 and later support WITH\_ACK. The current version is 0.0.4.

---

<div class="post-metadata">

**Author:** ![UMD](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/umd/32/5850_2.png) [@UMD](https://community.particle.io/u/UMD)\
**Post date:** [June 27, 2019, 1:07pm UTC](https://community.particle.io/t/publishquequeasyncrk-with-ack-issue-any-solution/50721/3 "2019-06-27T13:07:04Z")

</div>

Aha! Too easy!

Could you point me to the correct repo? Sounds like I have picked up old code then…

---

<div class="post-metadata">

**Author:** ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)\
**Post date:** [June 27, 2019, 1:13pm UTC](https://community.particle.io/t/publishquequeasyncrk-with-ack-issue-any-solution/50721/4 "2019-06-27T13:13:21Z")

</div>

> **[rickkas7/PublishQueueAsyncRK](https://github.com/rickkas7/PublishQueueAsyncRK)**
>
> A library for asynchronous Particle.publish. Contribute to rickkas7/PublishQueueAsyncRK development by creating an account on GitHub.

It’s in the community libraries as [https://github.com/rickkas7/PublishQueueAsyncRK](https://github.com/rickkas7/PublishQueueAsyncRK). It looks like version 0.0.4 is available there.

---

<div class="post-metadata">

**Author:** ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)\
**Post date:** [June 27, 2019, 2:25pm UTC](https://community.particle.io/t/publishquequeasyncrk-with-ack-issue-any-solution/50721/5 "2019-06-27T14:25:53Z")

</div>

Oh I see the problem. I forgot to change some of the comments. It does actually work.

---

<div class="post-metadata">

**Author:** ![UMD](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/umd/32/5850_2.png) [@UMD](https://community.particle.io/u/UMD)\
**Post date:** [June 27, 2019, 10:49pm UTC](https://community.particle.io/t/publishquequeasyncrk-with-ack-issue-any-solution/50721/6 "2019-06-27T22:49:58Z")

</div>

@rickkas7, then I am not going mad!

As there is no issue with using WITH\_ACK per se, we can concentrate on the issue as described. I don’t think it is within the library itself, but Particle.publish().

I will characterise and report back.

---

<div class="post-metadata">

**Author:** ![UMD](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/umd/32/5850_2.png) [@UMD](https://community.particle.io/u/UMD)\
**Post date:** [June 28, 2019, 1:01am UTC](https://community.particle.io/t/publishquequeasyncrk-with-ack-issue-any-solution/50721/7 "2019-06-28T01:01:07Z")

</div>

@rickkas7 happy to report, case closed!

Works as expected using **WITH\_ACK**

- every cached unsuccessful event has made it to the cloud once data+wifi has been established
- have not had a case, so far, of having thought that an event was sent, but was not actually received (which was my issue using **NO\_ACK** when I was “forced” to use it due the erroneous comment reads)
