Add support for pattern listening.