use events for processing samples.