Generalise get_executor() to apply to any type.