client: Add new API to handle pending events