def METHOD_NAME(
    self, server_message: transport_pb2.ServerMessage, timeout: Optional[float]
) -> transport_pb2.ClientMessage:
    task_ins = task_pb2.TaskIns(
        task_id="",
        group_id="",
        workload_id="",
        task=task_pb2.Task(
            producer=node_pb2.Node(
                node_id=0,
                anonymous=True,
            ),
            consumer=node_pb2.Node(
                node_id=self.node_id,
                anonymous=self.anonymous,
            ),
            legacy_server_message=server_message,
        ),
    )
    push_task_ins_req = driver_pb2.PushTaskInsRequest(task_ins_list=[task_ins])
    # Send TaskIns to Driver API
    push_task_ins_res = self.driver.push_task_ins(req=push_task_ins_req)
    if len(push_task_ins_res.task_ids) != 1:
        raise ValueError("Unexpected number of task_ids")
    task_id = push_task_ins_res.task_ids[0]
    if task_id == "":
        raise ValueError(f"Failed to schedule task for node {self.node_id}")
    if timeout:
        start_time = time.time()
    while True:
        pull_task_res_req = driver_pb2.PullTaskResRequest(
            node=node_pb2.Node(node_id=0, anonymous=True),
            task_ids=[task_id],
        )
        # Ask Driver API for TaskRes
        pull_task_res_res = self.driver.pull_task_res(req=pull_task_res_req)
        task_res_list: List[task_pb2.TaskRes] = list(
            pull_task_res_res.task_res_list
        )
        if len(task_res_list) == 1:
            task_res = task_res_list[0]
            return serde.client_message_from_proto(  # type: ignore
                task_res.task.legacy_client_message
            )
        if timeout is not None and time.time() > start_time + timeout:
            raise RuntimeError("Timeout reached")
        time.sleep(SLEEP_TIME)