# Question about Particle.publish() execution with TTL specified

**URL:** <https://community.particle.io/t/question-about-particle-publish-execution-with-ttl-specified/50311>\
**Category:** Firmware\
**Created:** [June 12, 2019, 2:59pm UTC](https://community.particle.io/t/question-about-particle-publish-execution-with-ttl-specified/50311 "2019-06-12T14:59:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![thenation34](https://avatars.discourse-cdn.com/v4/letter/t/e9c0ed/32.png) [@thenation34](https://community.particle.io/u/thenation34)\
**Post date:** [June 12, 2019, 2:59pm UTC](https://community.particle.io/t/question-about-particle-publish-execution-with-ttl-specified/50311/1 "2019-06-12T14:59:45Z")

</div>

When making a Particle.publish() call like the one below, how does the specified Time To Live (TTL) value of 60 seconds affect how the code executes?

Particle.publish(eventName, data, 60, PRIVATE);

- Does this command pause execution until it has successfully published within the 60 second timeframe? (i.e. waits for confirmation from the cloud of received publish?)
- If it does not successfully publish during 60 seconds, does it stop attempting?
- Does the code pause execution altogether at this command, wait 60 seconds, then publish the data?

I’m likely overthinking this one, but I haven’t found anything in the Firmware Guide that has given me a definitive answer on this. Thanks for your help!

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [June 12, 2019, 3:02pm UTC](https://community.particle.io/t/question-about-particle-publish-execution-with-ttl-specified/50311/2 "2019-06-12T15:02:42Z")

</div>

Hmm, how about this  
[https://docs.particle.io/reference/device-os/firmware/photon/#particle-publish-](https://docs.particle.io/reference/device-os/firmware/photon/#particle-publish-)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/4/6/4615d80741adde4f0d144b30cd69b8c589d2a9c5.png)

Even if it was implemented, the actual intent of TTL would be the period how long the event will stay valid _after_ it was delivered to the cloud before it vanishes and has nothing to do with the code flow.

Regarding code flow in connection with the publishing it self there are the two flags `WITH_ACK` and `NO_ACK` and also this post

> [@Particle publish with WITH\_ACK not working properly?](https://community.particle.io/t/particle-publish-with-with-ack-not-working-properly/30582/10):
>
> Particle.publish returns a “future” bool and doesn’t actually block until the return value is accessed. Something like the following will result in expected blocking behavior without requiring explicit/arbitrary delays. bool rval = Particle.publish(...); if(!rval) { Log.info("an error!"); } Documentation could definitely be updated for clarity…

---

<div class="post-metadata">

**Author:** ![thenation34](https://avatars.discourse-cdn.com/v4/letter/t/e9c0ed/32.png) [@thenation34](https://community.particle.io/u/thenation34)\
**Post date:** [June 12, 2019, 3:44pm UTC](https://community.particle.io/t/question-about-particle-publish-execution-with-ttl-specified/50311/3 "2019-06-12T15:44:16Z")

</div>

Condescension aside, the statement in the manual you posted still does not definitively answer what the intention of TTL is regardless of if it is currently implemented or not. Thanks for answering my question below that. Have a great day.

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [June 12, 2019, 4:15pm UTC](https://community.particle.io/t/question-about-particle-publish-execution-with-ttl-specified/50311/4 "2019-06-12T16:15:31Z")

</div>

> [@thenation34](#):
>
> the statement in the manual you posted still does not definitively answer what the intention of TTL is regardless of if it is currently implemented or not

Granted, that could be clearer.  
However, since TTL (time-to-live) is not a term coined by Particle but widely used in similar connections (e.g. [Time to live - Wikipedia](https://en.wikipedia.org/wiki/Time_to_live)) that extra clarification was traded for conciseness.

---

<div class="post-metadata">

**Author:** ![abatardi](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@abatardi](https://community.particle.io/u/abatardi)\
**Post date:** [August 2, 2019, 6:03pm UTC](https://community.particle.io/t/question-about-particle-publish-execution-with-ttl-specified/50311/5 "2019-08-02T18:03:28Z")

</div>

Seems we are going on 3+ years now with TTL still not implemented, does anyone know the status? I’m guessing we’re never actually going to see this feature.

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [August 2, 2019, 6:20pm UTC](https://community.particle.io/t/question-about-particle-publish-execution-with-ttl-specified/50311/6 "2019-08-02T18:20:14Z")

</div>

@abatardi, I would not count on TTL ever being implemented.
