Domanda

This makes sense to me but some other folks have said it doesn't make sense to them.

I have an Ajax call to a Rails API from a web page. If the request starts and the browser is closed, the API still completes. Do any application servers/web servers notice that the request has been stopped and stop the process?

Thanks.

È stato utile?

Soluzione

I don't know of any servers that would stop a process when a request is closed.

I think it would be a bug if the server cancelled an operation because the request channel was closed. Once an operation is initiated it should always complete unless there is an explicit mechanism to cancel the operation, or there is some kind of transaction mechanism that the client failed to complete. Otherwise users with faulty Internet connections or those in a big a hurry will spend a lot of time wondering why something they started didn't work.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top