added SetIdleFunc().
The user idle callback function can use a select on input channels and a time.After() to process external events without taking too much CPU