long frameNumber = ...;
int framesInFlight = 3;

final var commandPools =
  VulkanCommandPoolHandler.create(
    device,
    index -> "CommandPool[%d]".formatted(index),
    Set.of(),
    graphicsQueue.queueFamilyIndex(),
    framesInFlight
  );

while (true) {
  final var poolFrame = commandPools.beginFrame(frameNumber % framesInFlight);
  try (final var commandBuffer =
    poolFrame.createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY)) {
    ...
  }
}

// On shutdown
commandPools.close();
