# How can this done?

**URL:** <https://discourse.julialang.org/t/how-can-this-done/4330>\
**Category:** General Usage\
**Created:** [June 17, 2017, 7:40pm UTC](https://discourse.julialang.org/t/how-can-this-done/4330 "2017-06-17T19:40:12Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![adamslc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adamslc/32/3452_2.png) [@adamslc](https://discourse.julialang.org/u/adamslc)\
**Post date:** [June 17, 2017, 7:43pm UTC](https://discourse.julialang.org/t/how-can-this-done/4330/2 "2017-06-17T19:43:10Z")

</div>

I answered a similar question here:

> [@Polling keyboard input looking for e.g. 'q' in a loop to 'gracefully' terminate execution](https://discourse.julialang.org/t/polling-keyboard-input-looking-for-e-g-q-in-a-loop-to-gracefully-terminate-execution/812):
>
> I have a main loop that continuously acquires camera frames and some digital signals and progressively stores all data using the HDF5 module. I want this loop to terminate when the user presses a single keyboard key, e.g. ‘q’, by ‘gracefully’ releasing all the open files and hardware resources. The key idea behind this loop is that it should never block or otherwise spend a significant amount of time executing a single statement. Ideally I want the time spent inside the loop body on all statemen…

---

_[View the full topic](https://discourse.julialang.org/t/how-can-this-done/4330)._
