martin-g commented on code in PR #509:
URL: https://github.com/apache/wicket/pull/509#discussion_r847987046


##########
wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/WebSocketResponse.java:
##########
@@ -87,13 +98,27 @@ public void close()
                        {
                                if (text != null)
                                {
-                                       connection.sendMessage(text.toString());
+                                       if (asynchronous)
+                                       {
+                                               
connection.sendMessageAsync(text.toString(), timeout);
+                                       }
+                                       else
+                                       {
+                                               
connection.sendMessage(text.toString());
+                                       }
                                        text = null;
                                }
                                else if (binary != null)
                                {
                                        byte[] bytes = binary.toByteArray();
-                                       connection.sendMessage(bytes, 0, 
bytes.length);
+                                       if (asynchronous)
+                                       {
+                       connection.sendMessageAsync(bytes, 0, bytes.length, 
timeout);

Review Comment:
   indentation issue



##########
wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/IWebSocketConnection.java:
##########
@@ -130,6 +130,31 @@
         */
        void sendMessage(IWebSocketPushMessage message);
 
+       /**
+        * Broadcasts a push message to the wicket page (and it's components) 
associated with this
+        * connection. The components can then send messages or component 
updates to client by adding
+        * them to the target. Pushing to client is done asynchronously.
+        *
+        * @param message
+        *     the push message to send
+        *
+        */
+       void sendMessageAsync(IWebSocketPushMessage message);

Review Comment:
   Looking at the code it won't be easy ...



##########
wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/IWebSocketConnection.java:
##########
@@ -130,6 +130,31 @@
         */
        void sendMessage(IWebSocketPushMessage message);
 
+       /**
+        * Broadcasts a push message to the wicket page (and it's components) 
associated with this
+        * connection. The components can then send messages or component 
updates to client by adding
+        * them to the target. Pushing to client is done asynchronously.
+        *
+        * @param message
+        *     the push message to send
+        *
+        */
+       void sendMessageAsync(IWebSocketPushMessage message);

Review Comment:
   The earlier methods return `Future<Void>`. Can we do the same here too ?



-- 
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]

Reply via email to