I have the "autoConnect" option set to true on <p:socket> and it is placed in the template of my application. I am implementing a push notification feature, similar to chat, where as soon as the user logs into the app, Administrators can send them push notifications.
My question is whether setting autoConnect="true" is safe to do in the template - this will get evaluated on every page turn. Will it try to connect on every page turn? Will it cause issues or is it bad practice?
Thanks.
<p:socket> "autoConnect" option
-
- Posts: 6144
- Joined: 10 Sep 2011, 21:10
autoConnect=true is default. please see PrimeFaces user guide and p:socket details.wschmitz wrote:I have the "autoConnect" option set to true on <p:socket> and it is placed in the template of my application. I am implementing a push notification feature, similar to chat, where as soon as the user logs into the app, Administrators can send them push notifications.
Yes, it is safe, and yes it will try to connect on every non-AJAX page request. That is what it does in my app, and I have many non-AJAX page requests, and it does a new connection on every non-AJAX page request. That causes no issues in my app.wschmitz wrote:My question is whether setting autoConnect="true" is safe to do in the template - this will get evaluated on every page turn. Will it try to connect on every page turn? Will it cause issues or is it bad practice?
Howard
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome
Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache
-
- Information
-
Who is online
Users browsing this forum: No registered users and 21 guests