Allow passing a `this` pointer for callbacks.