async def METHOD_NAME(
    request: CompileParams,
    workspace: Workspace,
) -> CompileResult:
    bsp_targets = await MultiGet(
        Get(BSPBuildTargetInternal, BuildTargetIdentifier, bsp_target_id)
        for bsp_target_id in request.targets
    )
    compile_results = await MultiGet(
        Get(
            BSPCompileResult,
            CompileOneBSPTargetRequest(
                bsp_target=bsp_target,
                origin_id=request.origin_id,
                arguments=request.arguments,
            ),
        )
        for bsp_target in bsp_targets
    )
    output_digest = await Get(Digest, MergeDigests([r.output_digest for r in compile_results]))
    if output_digest != EMPTY_DIGEST:
        workspace.write_digest(output_digest, path_prefix=".pants.d/bsp")
    status_code = StatusCode.OK
    if any(r.status != StatusCode.OK for r in compile_results):
        status_code = StatusCode.ERROR
    return CompileResult(
        origin_id=request.origin_id,
        status_code=status_code.value,
    )