system
(system)
April 1, 2021, 10:13pm
1
This topic was automatically generated from Slack. You can find the original thread here .
gregonarash : is there a way to use settimeout inside of nodejs step? Adding await does not really await for the timeout to resolve. I am trying to execute 2 url calls spaced out by 30 seconds.
system
(system)
April 1, 2021, 10:13pm
2
Dylan Sather (Pipedream) : there’s an action - Wait N milliseconds - that wraps this logic. See this workflow . Code is:
await new Promise(resolve => setTimeout(resolve, milliseconds))
system
(system)
April 1, 2021, 10:13pm
3
gregonarash : Thank you so much! This was not obvious for me!
system
(system)
April 1, 2021, 10:13pm
4
Dylan Sather (Pipedream) : async / await and Promises are hard, took me years to really grok
system
(system)
April 1, 2021, 10:13pm
5
Dylan Sather (Pipedream) : and still don’t understand 100%!
system
(system)
April 1, 2021, 10:13pm
6
Dylan Sather (Pipedream) : this is a great deep dive if you ever want a fun read: Asynchronous Programming :: Eloquent JavaScript
system
(system)
April 1, 2021, 10:13pm
7
gregonarash : funny enough I am on an earlier chapter of this book…
system
(system)
April 1, 2021, 10:13pm
8
Dylan Sather (Pipedream) : haha nice. I haven’t read the whole thing but I like the writing