Correct way of defining a service call as a method inside a class

Hi
Firstly i am not sure if i titled the question correctly but here is what i want to do.

in exercise 4.3 we have the following code:

# import the empty module from std_servs Service interface
from std_srvs.srv import Empty
# import the ROS2 Python client libraries
import rclpy
from rclpy.node import Node


class ClientAsync(Node):

    def __init__(self):
        # Here you have the class constructor

        # call the class constructor to initialize the node as service_client
        super().__init__('service_client')
        # create the Service Client object
        # defines the name and type of the Service Server you will work with.
        self.client = self.create_client(Empty, 'moving')
        # checks once per second if a Service matching the type and name of the Client is available.
        while not self.client.wait_for_service(timeout_sec=1.0):
            # if it is not available, a message is displayed
            self.get_logger().info('service not available, waiting again...')
        
        # create an Empty request
        self.req = Empty.Request()
        

    def send_request(self):
        
        # send the request
        self.future = self.client.call_async(self.req)


def main(args=None):
    # initialize the ROS communication
    rclpy.init(args=args)
    # declare the node constructor
    client = ClientAsync()
    # run the send_request() method
    client.send_request()

    while rclpy.ok():
        # pause the program execution, waits for a request to kill the node (ctrl+c)
        rclpy.spin_once(client)
        if client.future.done():
            try:
                # checks the future for a response from the Service
                # while the system is running. 
                # If the Service has sent a response, the result will be written
                # to a log message.
                response = client.future.result()
            except Exception as e:
                # Display the message on the console
                client.get_logger().info(
                    'Service call failed %r' % (e,))
            else:
                # Display the message on the console
                client.get_logger().info(
                    'the robot is moving' ) 
            break

    client.destroy_node()
    # shutdown the ROS communication
    rclpy.shutdown()


if __name__ == '__main__':
    main()

I would like to create a part of the “main” method inside the class ClientAsync but i dont know on how to correctly “inhert” the rclpy.spin_once() method this is something i imagine i will be looking at quite a lot in ros.
so the method program should look something similar to this:

# import the empty module from std_servs Service interface
from std_srvs.srv import Empty

# import the ROS2 Python client libraries
import rclpy
from rclpy.node import Node
import time


class ClientAsync(Node):

    def __init__(self):
        # Here you have the class constructor

        # call the class constructor to initialize the node as service_client
        super().__init__('service_client')
        # create the Service Client object
        # defines the name and type of the Service Server you will work with.
        self.client = self.create_client(Empty, 'moving')
        self.client2 = self.create_client(Empty, "/stop")
        self.reset_gazebo = self.create_client(Empty, "/reset_simulation")
        # checks once per second if a Service matching the type and name of the Client is available.
        while not self.client.wait_for_service(timeout_sec=1.0):
            # if it is not available, a message is displayed
            self.get_logger().info('service not available, waiting again...')

        
        # create an Empty request
        self.req = Empty.Request()
        
        

    def send_request(self):
        
        # send the request
        self.future = self.client.call_async(self.req)

    
    def start_moving(self):
        self.send_request()

        while rclpy.ok(): #this should be inherited somehow from the main() function
        # pause the program execution, waits for a request to kill the node (ctrl+c)
            rclpy.spin_once()
            if self.future.done():
                try:
                    # checks the future for a response from the Service
                    # while the system is running. 
                    # If the Service has sent a response, the result will be written
                    # to a log message.
                    response = self.future.result()
                except Exception as e:
                    # Display the message on the console
                    self.get_logger().info(
                        'Service call failed %r' % (e,))
                else:
                    # Display the message on the console
                    self.get_logger().info(
                        'the robot is moving' ) 
                break


def main(args=None):
    # initialize the ROS communication
    rclpy.init(args=args)
    # declare the node constructor
    client = ClientAsync()
    # run the send_request() method
    client.start_moving()

   

    client.destroy_node()
    # shutdown the ROS communication
    rclpy.shutdown()


if __name__ == '__main__':
    main()

basically in def start_moving is where i block the execution of the program with the spin_once inside a while loop untill the response is recived
thanks ziga