A wait method is a custom API method that holds a request until a long-running operation is resolved or rejected. It offers an alternative to client-controlled polling, which repeatedly retrieves an operation resource until its done field is true. section 10.3.3
Choose between the two resolution patterns according to where control and request cost should reside:
- Use polling when the client needs to control request frequency, stop checking, or define how timely the result must be. section 10.3.3
Creating a chat room and waiting
CreateChatRoom returns an Operation. The client passes its ID to WaitOperation, then reads operation.result as the completed ChatRoom.
