|
85 | 85 | * sender.flush(); |
86 | 86 | * } |
87 | 87 | * </pre> |
| 88 | + * <p> |
| 89 | + * Failure handling: after this sender has established a WebSocket connection, |
| 90 | + * any WebSocket send failure, receive failure, ACK timeout, server error ACK, |
| 91 | + * invalid ACK, or server close is terminal for this sender instance. The first |
| 92 | + * such failure is retained and subsequent public operations rethrow the same |
| 93 | + * {@link LineSenderException}. {@link #reset()} only discards buffered row data; |
| 94 | + * it does not recover a terminal WebSocket failure. To resume sending after a |
| 95 | + * terminal WebSocket failure, close this sender and create a new instance. |
| 96 | + * <p> |
| 97 | + * Initial connection failures are not retained as terminal sender state; a later |
| 98 | + * operation may try to connect again. |
88 | 99 | */ |
89 | 100 | public class QwpWebSocketSender implements Sender { |
90 | 101 |
|
@@ -730,6 +741,20 @@ public QwpWebSocketSender floatColumn(CharSequence columnName, float value) { |
730 | 741 | return this; |
731 | 742 | } |
732 | 743 |
|
| 744 | + /** |
| 745 | + * Flushes buffered rows and waits until the server acknowledges all submitted |
| 746 | + * WebSocket batches. |
| 747 | + * <p> |
| 748 | + * If a WebSocket send, receive, ACK timeout, server error ACK, invalid ACK, |
| 749 | + * or server close is observed after the connection has been established, the |
| 750 | + * sender enters a terminal failed state. The first failure is retained and |
| 751 | + * subsequent public operations rethrow the same {@link LineSenderException}. |
| 752 | + * Create a new sender to resume sending. |
| 753 | + * |
| 754 | + * @throws LineSenderException if the sender is closed, a row is still in |
| 755 | + * progress, connection setup fails, or a terminal |
| 756 | + * WebSocket failure is observed |
| 757 | + */ |
733 | 758 | @Override |
734 | 759 | public void flush() { |
735 | 760 | checkNotClosed(); |
|
0 commit comments