def METHOD_NAME(
    self,
    commit: Commit,
    partitions: Mapping[Partition, int],
) -> ProcessingStrategy[KafkaPayload]:
    if self.force_synchronous:
        return RunTask(
            function=process_message,
            next_step=CommitOffsets(commit),
        )
    elif self.use_processes:
        return RunTaskWithMultiprocessing(
            function=process_message,
            next_step=CommitOffsets(commit),
            num_processes=self.num_processes,
            max_batch_size=self.max_batch_size,
            max_batch_time=self.max_batch_time,
            input_block_size=self.input_block_size,
            output_block_size=self.output_block_size,
        )
    else:
        # By default we preserve the previous behavior.
        return RunTask(
            function=initialize_threaded_context,
            next_step=RunTaskInThreads(
                processing_function=process_message_threaded,
                concurrency=self.num_threads,
                max_pending_futures=50,
                next_step=CommitOffsets(commit),
            ),
        )