use of org.apache.wicket.protocol.ws.concurrent.Executor in project wicket by apache.
the class WebSocketPushBroadcaster method process.
private void process(final Application application, final Collection<IWebSocketConnection> wsConnections, final IWebSocketPushMessage message) {
WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(application);
Executor executor = webSocketSettings.getWebSocketPushMessageExecutor();
for (final IWebSocketConnection wsConnection : wsConnections) {
executor.run(new Runnable() {
@Override
public void run() {
wsConnection.sendMessage(message);
}
});
}
}
use of org.apache.wicket.protocol.ws.concurrent.Executor in project openmeetings by apache.
the class WebSocketHelper method sendClient.
private static void sendClient(IWsClient client, Consumer<IWebSocketConnection> wsc) {
Application app = (Application) getApp();
WebSocketSettings settings = WebSocketSettings.Holder.get(app);
IWebSocketConnectionRegistry reg = settings.getConnectionRegistry();
// FIXME TODO
Executor executor = settings.getWebSocketPushMessageExecutor();
final IWebSocketConnection wc = reg.getConnection(app, client.getSessionId(), new PageIdKey(client.getPageId()));
if (wc != null && wc.isOpen()) {
executor.run(() -> {
wsc.accept(wc);
});
}
}
Aggregations