Maybe it would be good to be able to pass a context for the store, so the loop stops when the context cancelled.