added Generic Gateway that performs a task and sleeps for n interval