docs: def task_transaction(channel):
      """Ensures a task is fetched and acknowledged atomically."""
      with channel.lock:
          if channel.poll(0):
              task = channel.recv()
              channel.send(Acknowledgement(os.getpid(), task.id))
          else:
              raise RuntimeError("Race condition between workers")
  
      return task