Awaitility in production?

1,360 views
Skip to first unread message

Micah Silverman

unread,
Jun 1, 2015, 12:56:43 PM6/1/15
to await...@googlegroups.com
I have an async process. There's something that I want to do once the process is done. It's a non-critical task. Meaning, it's ok if the task doesn't get done.

I was thinking that I would use awaitility to check for up to 1 second to see if the process is done and then perform the task.

If it's not done in a second and the task is never performed - no big deal.

What do you think of using awaitility in a production setting?

The alternative, is to use a typical polling loop that iterates 10 times with a 100ms sleep in it if the process is not done.

Thanks,

Micah

Johan Haleby

unread,
Jun 2, 2015, 2:32:46 AM6/2/15
to await...@googlegroups.com
While you could use Awaility for this it's probably overkill. For example if you're using Spring you could just use the @Scheduled annotation and if not you could simply create a ScheduledExecutorService yourself. That way you avoid additional dependencies to your build which is always nice. Also Awaitility will block the current thread which is most likely not what you want.

--
You received this message because you are subscribed to the Google Groups "Awaitility" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awaitility+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages