How to efficiently process notifications