If no one takes over the ticket for 15 s, the system will remind the next single user that no one takes over the ticket using thinkphp to write the interface for Android and Ios (either the client or the server) the client sends an order, and the server receives the Order. If no response is sent to the client for 15 s, this interface is provided... if no ticket is received for 15 seconds, the system will remind the next single user to receive the ticket.
It is an interface written by thinkphp for Android and Ios.
(Two ends: one is the client, the other is the server, and the other is the server)
The client sends an order. the server receives the Order. If no response is sent to the client for 15 seconds
How can this interface be implemented?
Reply content:
If no ticket is received for 15 seconds, the system will remind the next single user to receive the ticket.
It is an interface written by thinkphp for Android and Ios.
(Two ends: one is the client, the other is the server, and the other is the server)
The client sends an order. the server receives the Order. If no response is sent to the client for 15 seconds
How can this interface be implemented?
How can I hand it over to the client?
If the interface has a response within 15 s, it will be processed. if there is no response, no response will be received on the client.
The client requests an interface after 15 s and returns whether a ticket is received.
Var ajaxTimeoutTest = $. ajax ({url: '', // request URL ** timeout: 1000, // timeout value, in milliseconds ** type: 'GET', // request method, get or post data :{}, // request parameters, json format Ype: 'json', // returned data format success: function (data) {// callback function alert ("successful");}, complete: function (XMLHttpRequest, status) {// after the request is complete, the final execution parameter if (status = 'timeout') {// times out, and the status also has the success and error values ajaxTimeoutTest. abort (); alert ("timeout ");}}});
You can set the timeout. if the time is up, execute the timeout method to prompt the client.
The first floor is correct, and you don't have to hand it over to the server. if you find that there is no response in the front end 15 seconds later, you will think that no one has received the order, or set the timer based on the user's order as the start time, after 15 seconds, the system will respond to the client. The Linux timer is named Linux CRON.