td icon indicating copy to clipboard operation
td copied to clipboard

Why do all td_receive calls, except the first one, take a long time to receive my specific response?

Open phpcxy opened this issue 4 months ago • 3 comments

Scenario

  1. Initialize TDLib instance
  2. td_send() -> td_receive() quickly returns response
  3. Wait some time
  4. Second td_send() -> td_receive() takes much longer to return response

During the delay in step 4, td_receive() returns other updates (e.g., "updateUser") before the actual response.

Questions

  1. Does TDLib process all accumulated updates before returning a specific operation's response?
  2. Is this behavior intentional? If so, why?
  3. Can we prioritize responses to specific operations over general updates?
  4. How to maintain consistent response times across operations, especially with accumulated updates?

phpcxy avatar Oct 18 '24 04:10 phpcxy