A library for flexible generic event threading