Good question, I'm not familiar with the cancel token but I think it can be done by creating two separate IPC handlers. The first IPC handler would send the request and save the cancel token. The second IPC handler would listen for cancel events from the frontend and use the token to cancel the request. Here's an example.
You can use the same cancel token to cancel multiple requests. If you want to cancel individual request you will need to create a hash or dictionary to store each request's cancel token. Then use `ipcMain.send` to send the key to the frontend. This key can be used by the frontend to cancel the specific request.
I hope that helps.