Add functions for operating on event streams