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:
- Exit the process from your game server
- Exit the process via the
StopProcess()
API endpoint - 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:
- Unity
- Unreal
- Godot
- JS / TS
NetworkManager.Singleton.Shutdown();
Environment.Exit(0);
FPlatformMisc::RequestExit(false)
get_tree().quit()
process.exit()
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).