Skip to main content

shutdownRpc()

function shutdownRpc(): void;

Defined in: src/lib/rpc/index.ts:197

Shutdown the RPC system.

This function:

  1. Rejects all pending RPC calls with a shutdown error
  2. Removes all handlers from the map (listeners become no-ops)
  3. Disposes response listener tracking
  4. Removes the global RPC interface

Important Notes

  • FiveM's underlying event listeners remain registered until resource stops
  • After shutdown, incoming RPC requests are silently ignored (handlers not found)
  • This is safe because FiveM automatically cleans up all handlers on resource stop

Returns

void