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

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

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


##########
wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/WebSocketRequestHandler.java:
##########
@@ -77,6 +78,36 @@ public void push(CharSequence message)
                }
        }
 
+       @Override
+       public Future<Void> pushAsync(CharSequence message, long timeout)
+       {
+               if (connection.isOpen())
+               {
+                       Args.notNull(message, "message");
+                       return connection.sendMessageAsync(message.toString(), 
timeout);
+               }
+               else
+               {
+                       LOG.warn("The websocket connection is already closed. 
Cannot push the text message '{}'", message);
+               }
+               return null;
+       }
+
+       @Override
+       public Future<Void> pushAsync(CharSequence message)

Review Comment:
   I would replace this method with `return pushAsync(message, -1)`





> 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