Added support for timeouts in wait_for_edge