It hangs around and waits for it. But the script could fork off a child to do the polling while the main script exits.

Cheers