Allow to set callback per thread.