이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 9. Message delivery
9.1. Sending messages 링크 복사링크가 클립보드에 복사되었습니다!
To send a message, override the on_sendable event handler and call the Sender.send() method. The sendable event fires when the Sender has enough credit to send at least one message.
Example: Sending messages
For more information, see the send.py example.
9.2. Tracking sent messages 링크 복사링크가 클립보드에 복사되었습니다!
When a message is sent, the sender can keep a reference to the delivery object representing the transfer. After the message is delivered, the receiver accepts or rejects it. The sender is notified of the outcome for each delivery.
To monitor the outcome of a sent message, override the on_accepted and on_rejected event handlers and map the delivery state update to the delivery returned from send().
Example: Tracking sent messages
9.3. Receiving messages 링크 복사링크가 클립보드에 복사되었습니다!
To receive a message, create a receiver and override the on_message event handler.
Example: Receiving messages
For more information, see the receive.py example.
9.4. Acknowledging received messages 링크 복사링크가 클립보드에 복사되었습니다!
To explicitly accept or reject a delivery, use the Delivery.update() method with the ACCEPTED or REJECTED state in the on_message event handler.
Example: Acknowledging received messages
By default, if you do not explicity acknowledge a delivery, then the library accepts it after on_message returns. To disable this behavior, set the auto_accept receiver option to false.