Have goroutine exit on signal via defer block.