Make period configurable.
Add a way to get the idle time
Add idle timeout.