Make context_switch for function consume definable per module