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

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

reiern70 commented on code in PR #509:
URL: https://github.com/apache/wicket/pull/509#discussion_r847694761


##########
wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/WebSocketResponse.java:
##########
@@ -87,13 +100,34 @@ public void close()
                        {
                                if (text != null)
                                {
-                                       connection.sendMessage(text.toString());
+                                       if (asynchronous)
+                                       {
+                                               if (timeout > 0)
+                                               {
+                                                       
connection.sendMessageAsync(text.toString(), timeout);
+                                               }
+                                               else
+                                               {
+                                                       
connection.sendMessageAsync(text.toString());
+                                               }
+                                       }
+                                       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);

Review Comment:
   Overlooked. Fixing, Thanks!





> allow to process web socket push messages in an asynchronous way.
> -----------------------------------------------------------------
>
>                 Key: WICKET-6969
>                 URL: https://issues.apache.org/jira/browse/WICKET-6969
>             Project: Wicket
>          Issue Type: Improvement
>            Reporter: Ernesto Reinaldo Barreiro
>            Priority: Major
>
> Currently web socket push messages are  always processed in a synchronous 
> way. Allow to configure applications to use by default asynchronous messages.



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

Reply via email to