parameters: (can_driver: AbstractCanDriver)
docstring: UI task to create and send messages.
  
      Args:
          can_driver: Can driver.
  
      Returns: None.
docstring_summary: UI task to create and send messages.
docstring_tokens: UI task to create and send messages .
function: async def ui_task(can_driver: AbstractCanDriver) -> None:
      """UI task to create and send messages.
  
      Args:
          can_driver: Can driver.
  
      Returns: None.
      """
      while True:
          try:
              # Run sync prompt message in threadpool executor.
              can_message = await asyncio.get_event_loop().run_in_executor(
                  None, prompt_message, input, print
              )
              await can_driver.send(can_message)
          except InvalidInput as e:
              print(str(e))
function_tokens: async def ui_task ( can_driver : AbstractCanDriver ) -> None : while True : try : # Run sync prompt message in threadpool executor. can_message = await asyncio . get_event_loop ( ) . run_in_executor ( None , prompt_message , input , print ) await can_driver . send ( can_message ) except InvalidInput as e : print ( str ( e ) )