Skip to main content

Terminate a process

Hathora bills you depending on how long your processes run for. Terminating a process will immediately stop the process and destroy all associated rooms. There are 3 ways a process can be terminated:

  1. Exit the process from your game server
  2. Exit the process via the StopProcess() API endpoint
  3. Idle process reaping (automated by Hathora) automatically terminates the process

Exit from game server

You may want to exit from your game server once your match ends so the billing clock ends immediately. The best way to terminate a process from your game server is to exit from the game engine you're using:

NetworkManager.Singleton.Shutdown();
Environment.Exit(0);

Exit via StopProcess() API endpoint

To kill a process from outside your game server, Hathora offers a StopProcess() API endpoint.

ProcessV2.stopProcess($APP_ID, $PROCESS_ID)

Idle process reaping (automated by Hathora)

Hathora's idle reaper will automatically detect and terminate a process that has been idle for 5 minutes (no active connections or rooms).