News for hackers. Stuff that matters.
Re:Load Balancing by throwaway71271 on Tuesday April 18, 2023 @10:10AM (#35614273)
pretty much the same way a push load balancer does https://github.com/jackdoe/back-to-back/blob/master/broker/b...

    for {
      select {
      case reply := <-replyChannel:
       if reply.Uuid == r.message.Uuid {
        return reply
       }
      case <-timeout:
       return makeError(r.message, MessageType_ERROR_CONSUMER_TIMEOUT, "consumer timed out")
      }
     }
not much different than what you do with normal http timeouts, you send a request, sometimes a response comes sometimes it doesnt, up to the load balancer to decide if it wants to retry or error out

also, queue does not mean async model, it means a queue, there are many queues in http requests responses (e.g. the listen(2) backlog queue itself) and it does not make it async :)

EDIT: i dont have reply button to your 'what if there is modified state' question, but the answer is: exactly the same as push load balancing when you dont receive the instance's response due to network failure, but it modified the state

Re:Load Balancing by gbuk2013 on Tuesday April 18, 2023 @10:20AM (#35614395)
> queue does not mean async model

“Message queues implement an asynchronous communication pattern between two or more processes/threads whereby the sending and receiving party do not need to interact with the message queue at the same time.”

https://en.m.wikipedia.org/wiki/Message_queue

Re:Load Balancing by throwaway71271 on Tuesday April 18, 2023 @10:59AM (#35614869)
if you read what i wrote, you will see that it is not asynchronous communication.

and it is not a message queue in the sense you mean, it is a request response queue, it just happens to be using messages

when people think of message queue they are thinking of async event driven communication, and this is not it

Re:Load Balancing by gbuk2013 on Tuesday April 18, 2023 @10:14AM (#35614330)
And what happens if your request modifies state but the response is not received?
Re:Load Balancing by throwaway71271 on Tuesday April 18, 2023 @10:56AM (#35614820)
exactly the same as push load balancing when it doesnt receive the instance's response due to network failure, but the state is modified