My applications process orders, and after the process, I would like to send the reservation data depending on which of my application partners made the reservation, so they can store a link to the reservation, And without deduction for other processing that must be performed my application.
I thought about how to send a message to a partner, and my decision would be to send a cURL POST request depending on which of my partners makes the reservation (in addition to answering my question, maybe someone has a better solution than this? )
Each partner will have a specific URL that will be configured to receive this POST request and save the reservation information that we send.
PROBLEM: If we try to send this POST request and their web server will be slow or down, we can wait too long to receive a response, which, in turn, will delay the confirmation of booking the actual user using our service.
PERFECT SOLUTION: I would like to send this PHP cURL request to another thread so that we can continue our fun and confirm the reservation. If there is a delay in another thread, this will not stop us.
Other solutions I reviewed:
- Calling an external script (e.g. written in python) to send this request. I read that using exec () can be very resource intensive. We have many orders, so we ship many of these orders. Therefore, ideally, we need something resource conscience.
- Using sockets. I am not familiar with their configuration, and I am worried that our socket server is down. It also looks like a maintenance mission. Maybe I'm wrong?
- Using a service like Pusher , which is actually a socket service. The disadvantage is that if the listener skips the message, he will never receive it again. For instance. partner will skip saving this reservation.
It would be great to get some feedback on what I am trying to do here, especially from those who need a solution for the same situation that I am in. Thanks for any help!
source share