write processEvents in the high level Session module