get from queue with timeout