[ 
https://issues.apache.org/jira/browse/WICKET-6967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17516091#comment-17516091
 ] 

ASF GitHub Bot commented on WICKET-6967:
----------------------------------------

martin-g commented on a change in pull request #506:
URL: https://github.com/apache/wicket/pull/506#discussion_r840866554



##########
File path: 
wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/IWebSocketConnection.java
##########
@@ -55,6 +56,27 @@
         */
        IWebSocketConnection sendMessage(String message) throws IOException;
 
+    /**
+     * Sends a text message to the client.

Review comment:
       Please add an explanation why/how this method is different than 
`#sendMessage()`

##########
File path: 
wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/util/tester/TestWebSocketConnection.java
##########
@@ -62,15 +63,44 @@ public IWebSocketConnection sendMessage(String message) 
throws IOException
                return this;
        }
 
-       @Override
+    @Override
+    public Future<Void> sendAsynchronousMessage(String message)
+    {
+        checkOpenness();
+        onOutMessage(message);
+        return null;

Review comment:
       Just delegate to `sendAsynchronousMessage(String message, long timeOut)` 
with a dummy value for `timeOut`

##########
File path: 
wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/IWebSocketConnection.java
##########
@@ -55,6 +56,27 @@
         */
        IWebSocketConnection sendMessage(String message) throws IOException;
 
+    /**
+     * Sends a text message to the client.
+     *
+     * @param message
+     *      the text message
+     * @return a {@link java.util.concurrent.Future} representing the send 
operation
+     *
+     */
+    Future<Void> sendAsynchronousMessage(String message);

Review comment:
       My personal preference for the name would be for `sendMessageAsync()`

##########
File path: 
wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/util/tester/TestWebSocketConnection.java
##########
@@ -62,15 +63,44 @@ public IWebSocketConnection sendMessage(String message) 
throws IOException
                return this;
        }
 
-       @Override
+    @Override
+    public Future<Void> sendAsynchronousMessage(String message)
+    {
+        checkOpenness();
+        onOutMessage(message);
+        return null;
+    }
+
+    @Override
+    public Future<Void> sendAsynchronousMessage(String message, long timeOut) {
+        checkOpenness();
+        onOutMessage(message);
+        return null;
+    }
+
+    @Override
        public IWebSocketConnection sendMessage(byte[] message, int offset, int 
length) throws IOException
        {
                checkOpenness();
                onOutMessage(message, offset, length);
                return this;
        }
 
-       /**
+    @Override
+    public Future<Void> sendAsynchronousMessage(byte[] message, int offset, 
int length) {
+        checkOpenness();
+        onOutMessage(message, offset, length);

Review comment:
       Same here




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


> allow to send non-blocking web socket messages
> ----------------------------------------------
>
>                 Key: WICKET-6967
>                 URL: https://issues.apache.org/jira/browse/WICKET-6967
>             Project: Wicket
>          Issue Type: Improvement
>            Reporter: Ernesto Reinaldo Barreiro
>            Priority: Major
>             Fix For: 10.0.0, 9.10.0
>
>




--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to